Return to start page

common.j

Code

		
1			//============================================================================
2 // Native types. All native functions take extended handle types when
3 // possible to help prevent passing bad values to native functions
4 //
5 type agent extends handle // all reference counted objects
6 type event extends agent // a reference to an event registration
7 type player extends agent // a single player reference
8 type widget extends agent // an interactive game object with life
9 type unit extends widget // a single unit reference
10 type destructable extends widget
11 type item extends widget
12 type ability extends agent
13 type buff extends ability
14 type force extends agent
15 type group extends agent
16 type trigger extends agent
17 type triggercondition extends agent
18 type triggeraction extends handle
19 type timer extends agent
20 type location extends agent
21 type region extends agent
22 type rect extends agent
23 type boolexpr extends agent
24 type sound extends agent
25 type conditionfunc extends boolexpr
26 type filterfunc extends boolexpr
27 type unitpool extends handle
28 type itempool extends handle
29 type race extends handle
30 type alliancetype extends handle
31 type racepreference extends handle
32 type gamestate extends handle
33 type igamestate extends gamestate
34 type fgamestate extends gamestate
35 type playerstate extends handle
36 type playerscore extends handle
37 type playergameresult extends handle
38 type unitstate extends handle
39 type aidifficulty extends handle
40
41 type eventid extends handle
42 type gameevent extends eventid
43 type playerevent extends eventid
44 type playerunitevent extends eventid
45 type unitevent extends eventid
46 type limitop extends eventid
47 type widgetevent extends eventid
48 type dialogevent extends eventid
49 type unittype extends handle
50
51 type gamespeed extends handle
52 type gamedifficulty extends handle
53 type gametype extends handle
54 type mapflag extends handle
55 type mapvisibility extends handle
56 type mapsetting extends handle
57 type mapdensity extends handle
58 type mapcontrol extends handle
59 type playerslotstate extends handle
60 type volumegroup extends handle
61 type camerafield extends handle
62 type camerasetup extends handle
63 type playercolor extends handle
64 type placement extends handle
65 type startlocprio extends handle
66 type raritycontrol extends handle
67 type blendmode extends handle
68 type texmapflags extends handle
69 type effect extends agent
70 type effecttype extends handle
71 type weathereffect extends handle
72 type terraindeformation extends handle
73 type fogstate extends handle
74 type fogmodifier extends agent
75 type dialog extends agent
76 type button extends agent
77 type quest extends agent
78 type questitem extends agent
79 type defeatcondition extends agent
80 type timerdialog extends agent
81 type leaderboard extends agent
82 type multiboard extends agent
83 type multiboarditem extends agent
84 type trackable extends agent
85 type gamecache extends agent
86 type version extends handle
87 type itemtype extends handle
88 type texttag extends handle
89 type attacktype extends handle
90 type damagetype extends handle
91 type weapontype extends handle
92 type soundtype extends handle
93 type lightning extends handle
94 type pathingtype extends handle
95 type image extends handle
96 type ubersplat extends handle
97 type hashtable extends agent
98
99 constant native ConvertRace takes integer i returns race
100 constant native ConvertAllianceType takes integer i returns alliancetype
101 constant native ConvertRacePref takes integer i returns racepreference
102 constant native ConvertIGameState takes integer i returns igamestate
103 constant native ConvertFGameState takes integer i returns fgamestate
104 constant native ConvertPlayerState takes integer i returns playerstate
105 constant native ConvertPlayerScore takes integer i returns playerscore
106 constant native ConvertPlayerGameResult takes integer i returns playergameresult
107 constant native ConvertUnitState takes integer i returns unitstate
108 constant native ConvertAIDifficulty takes integer i returns aidifficulty
109 constant native ConvertGameEvent takes integer i returns gameevent
110 constant native ConvertPlayerEvent takes integer i returns playerevent
111 constant native ConvertPlayerUnitEvent takes integer i returns playerunitevent
112 constant native ConvertWidgetEvent takes integer i returns widgetevent
113 constant native ConvertDialogEvent takes integer i returns dialogevent
114 constant native ConvertUnitEvent takes integer i returns unitevent
115 constant native ConvertLimitOp takes integer i returns limitop
116 constant native ConvertUnitType takes integer i returns unittype
117 constant native ConvertGameSpeed takes integer i returns gamespeed
118 constant native ConvertPlacement takes integer i returns placement
119 constant native ConvertStartLocPrio takes integer i returns startlocprio
120 constant native ConvertGameDifficulty takes integer i returns gamedifficulty
121 constant native ConvertGameType takes integer i returns gametype
122 constant native ConvertMapFlag takes integer i returns mapflag
123 constant native ConvertMapVisibility takes integer i returns mapvisibility
124 constant native ConvertMapSetting takes integer i returns mapsetting
125 constant native ConvertMapDensity takes integer i returns mapdensity
126 constant native ConvertMapControl takes integer i returns mapcontrol
127 constant native ConvertPlayerColor takes integer i returns playercolor
128 constant native ConvertPlayerSlotState takes integer i returns playerslotstate
129 constant native ConvertVolumeGroup takes integer i returns volumegroup
130 constant native ConvertCameraField takes integer i returns camerafield
131 constant native ConvertBlendMode takes integer i returns blendmode
132 constant native ConvertRarityControl takes integer i returns raritycontrol
133 constant native ConvertTexMapFlags takes integer i returns texmapflags
134 constant native ConvertFogState takes integer i returns fogstate
135 constant native ConvertEffectType takes integer i returns effecttype
136 constant native ConvertVersion takes integer i returns version
137 constant native ConvertItemType takes integer i returns itemtype
138 constant native ConvertAttackType takes integer i returns attacktype
139 constant native ConvertDamageType takes integer i returns damagetype
140 constant native ConvertWeaponType takes integer i returns weapontype
141 constant native ConvertSoundType takes integer i returns soundtype
142 constant native ConvertPathingType takes integer i returns pathingtype
143
144 constant native OrderId takes string orderIdString returns integer
145 constant native OrderId2String takes integer orderId returns string
146 constant native UnitId takes string unitIdString returns integer
147 constant native UnitId2String takes integer unitId returns string
148
149 // Not currently working correctly...
150 constant native AbilityId takes string abilityIdString returns integer
151 constant native AbilityId2String takes integer abilityId returns string
152
153 // Looks up the "name" field for any object (unit, item, ability)
154 constant native GetObjectName takes integer objectId returns string
155
156 globals
157
158 //===================================================
159 // Game Constants
160 //===================================================
161
162 // pfff
163 constant boolean FALSE = false
164 constant boolean TRUE = true
165 constant integer JASS_MAX_ARRAY_SIZE = 8192
166
167 constant integer PLAYER_NEUTRAL_PASSIVE = 15
168 constant integer PLAYER_NEUTRAL_AGGRESSIVE = 12
169
170 constant playercolor PLAYER_COLOR_RED = ConvertPlayerColor(0)
171 constant playercolor PLAYER_COLOR_BLUE = ConvertPlayerColor(1)
172 constant playercolor PLAYER_COLOR_CYAN = ConvertPlayerColor(2)
173 constant playercolor PLAYER_COLOR_PURPLE = ConvertPlayerColor(3)
174 constant playercolor PLAYER_COLOR_YELLOW = ConvertPlayerColor(4)
175 constant playercolor PLAYER_COLOR_ORANGE = ConvertPlayerColor(5)
176 constant playercolor PLAYER_COLOR_GREEN = ConvertPlayerColor(6)
177 constant playercolor PLAYER_COLOR_PINK = ConvertPlayerColor(7)
178 constant playercolor PLAYER_COLOR_LIGHT_GRAY = ConvertPlayerColor(8)
179 constant playercolor PLAYER_COLOR_LIGHT_BLUE = ConvertPlayerColor(9)
180 constant playercolor PLAYER_COLOR_AQUA = ConvertPlayerColor(10)
181 constant playercolor PLAYER_COLOR_BROWN = ConvertPlayerColor(11)
182
183 constant race RACE_HUMAN = ConvertRace(1)
184 constant race RACE_ORC = ConvertRace(2)
185 constant race RACE_UNDEAD = ConvertRace(3)
186 constant race RACE_NIGHTELF = ConvertRace(4)
187 constant race RACE_DEMON = ConvertRace(5)
188 constant race RACE_OTHER = ConvertRace(7)
189
190 constant playergameresult PLAYER_GAME_RESULT_VICTORY = ConvertPlayerGameResult(0)
191 constant playergameresult PLAYER_GAME_RESULT_DEFEAT = ConvertPlayerGameResult(1)
192 constant playergameresult PLAYER_GAME_RESULT_TIE = ConvertPlayerGameResult(2)
193 constant playergameresult PLAYER_GAME_RESULT_NEUTRAL = ConvertPlayerGameResult(3)
194
195 constant alliancetype ALLIANCE_PASSIVE = ConvertAllianceType(0)
196 constant alliancetype ALLIANCE_HELP_REQUEST = ConvertAllianceType(1)
197 constant alliancetype ALLIANCE_HELP_RESPONSE = ConvertAllianceType(2)
198 constant alliancetype ALLIANCE_SHARED_XP = ConvertAllianceType(3)
199 constant alliancetype ALLIANCE_SHARED_SPELLS = ConvertAllianceType(4)
200 constant alliancetype ALLIANCE_SHARED_VISION = ConvertAllianceType(5)
201 constant alliancetype ALLIANCE_SHARED_CONTROL = ConvertAllianceType(6)
202 constant alliancetype ALLIANCE_SHARED_ADVANCED_CONTROL= ConvertAllianceType(7)
203 constant alliancetype ALLIANCE_RESCUABLE = ConvertAllianceType(8)
204 constant alliancetype ALLIANCE_SHARED_VISION_FORCED = ConvertAllianceType(9)
205
206 constant version VERSION_REIGN_OF_CHAOS = ConvertVersion(0)
207 constant version VERSION_FROZEN_THRONE = ConvertVersion(1)
208
209 constant attacktype ATTACK_TYPE_NORMAL = ConvertAttackType(0)
210 constant attacktype ATTACK_TYPE_MELEE = ConvertAttackType(1)
211 constant attacktype ATTACK_TYPE_PIERCE = ConvertAttackType(2)
212 constant attacktype ATTACK_TYPE_SIEGE = ConvertAttackType(3)
213 constant attacktype ATTACK_TYPE_MAGIC = ConvertAttackType(4)
214 constant attacktype ATTACK_TYPE_CHAOS = ConvertAttackType(5)
215 constant attacktype ATTACK_TYPE_HERO = ConvertAttackType(6)
216
217 constant damagetype DAMAGE_TYPE_UNKNOWN = ConvertDamageType(0)
218 constant damagetype DAMAGE_TYPE_NORMAL = ConvertDamageType(4)
219 constant damagetype DAMAGE_TYPE_ENHANCED = ConvertDamageType(5)
220 constant damagetype DAMAGE_TYPE_FIRE = ConvertDamageType(8)
221 constant damagetype DAMAGE_TYPE_COLD = ConvertDamageType(9)
222 constant damagetype DAMAGE_TYPE_LIGHTNING = ConvertDamageType(10)
223 constant damagetype DAMAGE_TYPE_POISON = ConvertDamageType(11)
224 constant damagetype DAMAGE_TYPE_DISEASE = ConvertDamageType(12)
225 constant damagetype DAMAGE_TYPE_DIVINE = ConvertDamageType(13)
226 constant damagetype DAMAGE_TYPE_MAGIC = ConvertDamageType(14)
227 constant damagetype DAMAGE_TYPE_SONIC = ConvertDamageType(15)
228 constant damagetype DAMAGE_TYPE_ACID = ConvertDamageType(16)
229 constant damagetype DAMAGE_TYPE_FORCE = ConvertDamageType(17)
230 constant damagetype DAMAGE_TYPE_DEATH = ConvertDamageType(18)
231 constant damagetype DAMAGE_TYPE_MIND = ConvertDamageType(19)
232 constant damagetype DAMAGE_TYPE_PLANT = ConvertDamageType(20)
233 constant damagetype DAMAGE_TYPE_DEFENSIVE = ConvertDamageType(21)
234 constant damagetype DAMAGE_TYPE_DEMOLITION = ConvertDamageType(22)
235 constant damagetype DAMAGE_TYPE_SLOW_POISON = ConvertDamageType(23)
236 constant damagetype DAMAGE_TYPE_SPIRIT_LINK = ConvertDamageType(24)
237 constant damagetype DAMAGE_TYPE_SHADOW_STRIKE = ConvertDamageType(25)
238 constant damagetype DAMAGE_TYPE_UNIVERSAL = ConvertDamageType(26)
239
240 constant weapontype WEAPON_TYPE_WHOKNOWS = ConvertWeaponType(0)
241 constant weapontype WEAPON_TYPE_METAL_LIGHT_CHOP = ConvertWeaponType(1)
242 constant weapontype WEAPON_TYPE_METAL_MEDIUM_CHOP = ConvertWeaponType(2)
243 constant weapontype WEAPON_TYPE_METAL_HEAVY_CHOP = ConvertWeaponType(3)
244 constant weapontype WEAPON_TYPE_METAL_LIGHT_SLICE = ConvertWeaponType(4)
245 constant weapontype WEAPON_TYPE_METAL_MEDIUM_SLICE = ConvertWeaponType(5)
246 constant weapontype WEAPON_TYPE_METAL_HEAVY_SLICE = ConvertWeaponType(6)
247 constant weapontype WEAPON_TYPE_METAL_MEDIUM_BASH = ConvertWeaponType(7)
248 constant weapontype WEAPON_TYPE_METAL_HEAVY_BASH = ConvertWeaponType(8)
249 constant weapontype WEAPON_TYPE_METAL_MEDIUM_STAB = ConvertWeaponType(9)
250 constant weapontype WEAPON_TYPE_METAL_HEAVY_STAB = ConvertWeaponType(10)
251 constant weapontype WEAPON_TYPE_WOOD_LIGHT_SLICE = ConvertWeaponType(11)
252 constant weapontype WEAPON_TYPE_WOOD_MEDIUM_SLICE = ConvertWeaponType(12)
253 constant weapontype WEAPON_TYPE_WOOD_HEAVY_SLICE = ConvertWeaponType(13)
254 constant weapontype WEAPON_TYPE_WOOD_LIGHT_BASH = ConvertWeaponType(14)
255 constant weapontype WEAPON_TYPE_WOOD_MEDIUM_BASH = ConvertWeaponType(15)
256 constant weapontype WEAPON_TYPE_WOOD_HEAVY_BASH = ConvertWeaponType(16)
257 constant weapontype WEAPON_TYPE_WOOD_LIGHT_STAB = ConvertWeaponType(17)
258 constant weapontype WEAPON_TYPE_WOOD_MEDIUM_STAB = ConvertWeaponType(18)
259 constant weapontype WEAPON_TYPE_CLAW_LIGHT_SLICE = ConvertWeaponType(19)
260 constant weapontype WEAPON_TYPE_CLAW_MEDIUM_SLICE = ConvertWeaponType(20)
261 constant weapontype WEAPON_TYPE_CLAW_HEAVY_SLICE = ConvertWeaponType(21)
262 constant weapontype WEAPON_TYPE_AXE_MEDIUM_CHOP = ConvertWeaponType(22)
263 constant weapontype WEAPON_TYPE_ROCK_HEAVY_BASH = ConvertWeaponType(23)
264
265 constant pathingtype PATHING_TYPE_ANY = ConvertPathingType(0)
266 constant pathingtype PATHING_TYPE_WALKABILITY = ConvertPathingType(1)
267 constant pathingtype PATHING_TYPE_FLYABILITY = ConvertPathingType(2)
268 constant pathingtype PATHING_TYPE_BUILDABILITY = ConvertPathingType(3)
269 constant pathingtype PATHING_TYPE_PEONHARVESTPATHING = ConvertPathingType(4)
270 constant pathingtype PATHING_TYPE_BLIGHTPATHING = ConvertPathingType(5)
271 constant pathingtype PATHING_TYPE_FLOATABILITY = ConvertPathingType(6)
272 constant pathingtype PATHING_TYPE_AMPHIBIOUSPATHING = ConvertPathingType(7)
273
274 //===================================================
275 // Map Setup Constants
276 //===================================================
277
278 constant racepreference RACE_PREF_HUMAN = ConvertRacePref(1)
279 constant racepreference RACE_PREF_ORC = ConvertRacePref(2)
280 constant racepreference RACE_PREF_NIGHTELF = ConvertRacePref(4)
281 constant racepreference RACE_PREF_UNDEAD = ConvertRacePref(8)
282 constant racepreference RACE_PREF_DEMON = ConvertRacePref(16)
283 constant racepreference RACE_PREF_RANDOM = ConvertRacePref(32)
284 constant racepreference RACE_PREF_USER_SELECTABLE = ConvertRacePref(64)
285
286 constant mapcontrol MAP_CONTROL_USER = ConvertMapControl(0)
287 constant mapcontrol MAP_CONTROL_COMPUTER = ConvertMapControl(1)
288 constant mapcontrol MAP_CONTROL_RESCUABLE = ConvertMapControl(2)
289 constant mapcontrol MAP_CONTROL_NEUTRAL = ConvertMapControl(3)
290 constant mapcontrol MAP_CONTROL_CREEP = ConvertMapControl(4)
291 constant mapcontrol MAP_CONTROL_NONE = ConvertMapControl(5)
292
293 constant gametype GAME_TYPE_MELEE = ConvertGameType(1)
294 constant gametype GAME_TYPE_FFA = ConvertGameType(2)
295 constant gametype GAME_TYPE_USE_MAP_SETTINGS = ConvertGameType(4)
296 constant gametype GAME_TYPE_BLIZ = ConvertGameType(8)
297 constant gametype GAME_TYPE_ONE_ON_ONE = ConvertGameType(16)
298 constant gametype GAME_TYPE_TWO_TEAM_PLAY = ConvertGameType(32)
299 constant gametype GAME_TYPE_THREE_TEAM_PLAY = ConvertGameType(64)
300 constant gametype GAME_TYPE_FOUR_TEAM_PLAY = ConvertGameType(128)
301
302 constant mapflag MAP_FOG_HIDE_TERRAIN = ConvertMapFlag(1)
303 constant mapflag MAP_FOG_MAP_EXPLORED = ConvertMapFlag(2)
304 constant mapflag MAP_FOG_ALWAYS_VISIBLE = ConvertMapFlag(4)
305
306 constant mapflag MAP_USE_HANDICAPS = ConvertMapFlag(8)
307 constant mapflag MAP_OBSERVERS = ConvertMapFlag(16)
308 constant mapflag MAP_OBSERVERS_ON_DEATH = ConvertMapFlag(32)
309
310 constant mapflag MAP_FIXED_COLORS = ConvertMapFlag(128)
311
312 constant mapflag MAP_LOCK_RESOURCE_TRADING = ConvertMapFlag(256)
313 constant mapflag MAP_RESOURCE_TRADING_ALLIES_ONLY = ConvertMapFlag(512)
314
315 constant mapflag MAP_LOCK_ALLIANCE_CHANGES = ConvertMapFlag(1024)
316 constant mapflag MAP_ALLIANCE_CHANGES_HIDDEN = ConvertMapFlag(2048)
317
318 constant mapflag MAP_CHEATS = ConvertMapFlag(4096)
319 constant mapflag MAP_CHEATS_HIDDEN = ConvertMapFlag(8192)
320
321 constant mapflag MAP_LOCK_SPEED = ConvertMapFlag(8192*2)
322 constant mapflag MAP_LOCK_RANDOM_SEED = ConvertMapFlag(8192*4)
323 constant mapflag MAP_SHARED_ADVANCED_CONTROL = ConvertMapFlag(8192*8)
324 constant mapflag MAP_RANDOM_HERO = ConvertMapFlag(8192*16)
325 constant mapflag MAP_RANDOM_RACES = ConvertMapFlag(8192*32)
326 constant mapflag MAP_RELOADED = ConvertMapFlag(8192*64)
327
328 constant placement MAP_PLACEMENT_RANDOM = ConvertPlacement(0) // random among all slots
329 constant placement MAP_PLACEMENT_FIXED = ConvertPlacement(1) // player 0 in start loc 0...
330 constant placement MAP_PLACEMENT_USE_MAP_SETTINGS = ConvertPlacement(2) // whatever was specified by the script
331 constant placement MAP_PLACEMENT_TEAMS_TOGETHER = ConvertPlacement(3) // random with allies next to each other
332
333 constant startlocprio MAP_LOC_PRIO_LOW = ConvertStartLocPrio(0)
334 constant startlocprio MAP_LOC_PRIO_HIGH = ConvertStartLocPrio(1)
335 constant startlocprio MAP_LOC_PRIO_NOT = ConvertStartLocPrio(2)
336
337 constant mapdensity MAP_DENSITY_NONE = ConvertMapDensity(0)
338 constant mapdensity MAP_DENSITY_LIGHT = ConvertMapDensity(1)
339 constant mapdensity MAP_DENSITY_MEDIUM = ConvertMapDensity(2)
340 constant mapdensity MAP_DENSITY_HEAVY = ConvertMapDensity(3)
341
342 constant gamedifficulty MAP_DIFFICULTY_EASY = ConvertGameDifficulty(0)
343 constant gamedifficulty MAP_DIFFICULTY_NORMAL = ConvertGameDifficulty(1)
344 constant gamedifficulty MAP_DIFFICULTY_HARD = ConvertGameDifficulty(2)
345 constant gamedifficulty MAP_DIFFICULTY_INSANE = ConvertGameDifficulty(3)
346
347 constant gamespeed MAP_SPEED_SLOWEST = ConvertGameSpeed(0)
348 constant gamespeed MAP_SPEED_SLOW = ConvertGameSpeed(1)
349 constant gamespeed MAP_SPEED_NORMAL = ConvertGameSpeed(2)
350 constant gamespeed MAP_SPEED_FAST = ConvertGameSpeed(3)
351 constant gamespeed MAP_SPEED_FASTEST = ConvertGameSpeed(4)
352
353 constant playerslotstate PLAYER_SLOT_STATE_EMPTY = ConvertPlayerSlotState(0)
354 constant playerslotstate PLAYER_SLOT_STATE_PLAYING = ConvertPlayerSlotState(1)
355 constant playerslotstate PLAYER_SLOT_STATE_LEFT = ConvertPlayerSlotState(2)
356
357 //===================================================
358 // Sound Constants
359 //===================================================
360 constant volumegroup SOUND_VOLUMEGROUP_UNITMOVEMENT = ConvertVolumeGroup(0)
361 constant volumegroup SOUND_VOLUMEGROUP_UNITSOUNDS = ConvertVolumeGroup(1)
362 constant volumegroup SOUND_VOLUMEGROUP_COMBAT = ConvertVolumeGroup(2)
363 constant volumegroup SOUND_VOLUMEGROUP_SPELLS = ConvertVolumeGroup(3)
364 constant volumegroup SOUND_VOLUMEGROUP_UI = ConvertVolumeGroup(4)
365 constant volumegroup SOUND_VOLUMEGROUP_MUSIC = ConvertVolumeGroup(5)
366 constant volumegroup SOUND_VOLUMEGROUP_AMBIENTSOUNDS = ConvertVolumeGroup(6)
367 constant volumegroup SOUND_VOLUMEGROUP_FIRE = ConvertVolumeGroup(7)
368
369
370 //===================================================
371 // Game, Player, and Unit States
372 //
373 // For use with TriggerRegisterStateEvent
374 //
375 //===================================================
376
377 constant igamestate GAME_STATE_DIVINE_INTERVENTION = ConvertIGameState(0)
378 constant igamestate GAME_STATE_DISCONNECTED = ConvertIGameState(1)
379 constant fgamestate GAME_STATE_TIME_OF_DAY = ConvertFGameState(2)
380
381 constant playerstate PLAYER_STATE_GAME_RESULT = ConvertPlayerState(0)
382
383 // current resource levels
384 //
385 constant playerstate PLAYER_STATE_RESOURCE_GOLD = ConvertPlayerState(1)
386 constant playerstate PLAYER_STATE_RESOURCE_LUMBER = ConvertPlayerState(2)
387 constant playerstate PLAYER_STATE_RESOURCE_HERO_TOKENS = ConvertPlayerState(3)
388 constant playerstate PLAYER_STATE_RESOURCE_FOOD_CAP = ConvertPlayerState(4)
389 constant playerstate PLAYER_STATE_RESOURCE_FOOD_USED = ConvertPlayerState(5)
390 constant playerstate PLAYER_STATE_FOOD_CAP_CEILING = ConvertPlayerState(6)
391
392 constant playerstate PLAYER_STATE_GIVES_BOUNTY = ConvertPlayerState(7)
393 constant playerstate PLAYER_STATE_ALLIED_VICTORY = ConvertPlayerState(8)
394 constant playerstate PLAYER_STATE_PLACED = ConvertPlayerState(9)
395 constant playerstate PLAYER_STATE_OBSERVER_ON_DEATH = ConvertPlayerState(10)
396 constant playerstate PLAYER_STATE_OBSERVER = ConvertPlayerState(11)
397 constant playerstate PLAYER_STATE_UNFOLLOWABLE = ConvertPlayerState(12)
398
399 // taxation rate for each resource
400 //
401 constant playerstate PLAYER_STATE_GOLD_UPKEEP_RATE = ConvertPlayerState(13)
402 constant playerstate PLAYER_STATE_LUMBER_UPKEEP_RATE = ConvertPlayerState(14)
403
404 // cumulative resources collected by the player during the mission
405 //
406 constant playerstate PLAYER_STATE_GOLD_GATHERED = ConvertPlayerState(15)
407 constant playerstate PLAYER_STATE_LUMBER_GATHERED = ConvertPlayerState(16)
408
409 constant playerstate PLAYER_STATE_NO_CREEP_SLEEP = ConvertPlayerState(25)
410
411 constant unitstate UNIT_STATE_LIFE = ConvertUnitState(0)
412 constant unitstate UNIT_STATE_MAX_LIFE = ConvertUnitState(1)
413 constant unitstate UNIT_STATE_MANA = ConvertUnitState(2)
414 constant unitstate UNIT_STATE_MAX_MANA = ConvertUnitState(3)
415
416 constant aidifficulty AI_DIFFICULTY_NEWBIE = ConvertAIDifficulty(0)
417 constant aidifficulty AI_DIFFICULTY_NORMAL = ConvertAIDifficulty(1)
418 constant aidifficulty AI_DIFFICULTY_INSANE = ConvertAIDifficulty(2)
419
420 // player score values
421 constant playerscore PLAYER_SCORE_UNITS_TRAINED = ConvertPlayerScore(0)
422 constant playerscore PLAYER_SCORE_UNITS_KILLED = ConvertPlayerScore(1)
423 constant playerscore PLAYER_SCORE_STRUCT_BUILT = ConvertPlayerScore(2)
424 constant playerscore PLAYER_SCORE_STRUCT_RAZED = ConvertPlayerScore(3)
425 constant playerscore PLAYER_SCORE_TECH_PERCENT = ConvertPlayerScore(4)
426 constant playerscore PLAYER_SCORE_FOOD_MAXPROD = ConvertPlayerScore(5)
427 constant playerscore PLAYER_SCORE_FOOD_MAXUSED = ConvertPlayerScore(6)
428 constant playerscore PLAYER_SCORE_HEROES_KILLED = ConvertPlayerScore(7)
429 constant playerscore PLAYER_SCORE_ITEMS_GAINED = ConvertPlayerScore(8)
430 constant playerscore PLAYER_SCORE_MERCS_HIRED = ConvertPlayerScore(9)
431 constant playerscore PLAYER_SCORE_GOLD_MINED_TOTAL = ConvertPlayerScore(10)
432 constant playerscore PLAYER_SCORE_GOLD_MINED_UPKEEP = ConvertPlayerScore(11)
433 constant playerscore PLAYER_SCORE_GOLD_LOST_UPKEEP = ConvertPlayerScore(12)
434 constant playerscore PLAYER_SCORE_GOLD_LOST_TAX = ConvertPlayerScore(13)
435 constant playerscore PLAYER_SCORE_GOLD_GIVEN = ConvertPlayerScore(14)
436 constant playerscore PLAYER_SCORE_GOLD_RECEIVED = ConvertPlayerScore(15)
437 constant playerscore PLAYER_SCORE_LUMBER_TOTAL = ConvertPlayerScore(16)
438 constant playerscore PLAYER_SCORE_LUMBER_LOST_UPKEEP = ConvertPlayerScore(17)
439 constant playerscore PLAYER_SCORE_LUMBER_LOST_TAX = ConvertPlayerScore(18)
440 constant playerscore PLAYER_SCORE_LUMBER_GIVEN = ConvertPlayerScore(19)
441 constant playerscore PLAYER_SCORE_LUMBER_RECEIVED = ConvertPlayerScore(20)
442 constant playerscore PLAYER_SCORE_UNIT_TOTAL = ConvertPlayerScore(21)
443 constant playerscore PLAYER_SCORE_HERO_TOTAL = ConvertPlayerScore(22)
444 constant playerscore PLAYER_SCORE_RESOURCE_TOTAL = ConvertPlayerScore(23)
445 constant playerscore PLAYER_SCORE_TOTAL = ConvertPlayerScore(24)
446
447 //===================================================
448 // Game, Player and Unit Events
449 //
450 // When an event causes a trigger to fire these
451 // values allow the action code to determine which
452 // event was dispatched and therefore which set of
453 // native functions should be used to get information
454 // about the event.
455 //
456 // Do NOT change the order or value of these constants
457 // without insuring that the JASS_GAME_EVENTS_WAR3 enum
458 // is changed to match.
459 //
460 //===================================================
461
462 //===================================================
463 // For use with TriggerRegisterGameEvent
464 //===================================================
465
466 constant gameevent EVENT_GAME_VICTORY = ConvertGameEvent(0)
467 constant gameevent EVENT_GAME_END_LEVEL = ConvertGameEvent(1)
468
469 constant gameevent EVENT_GAME_VARIABLE_LIMIT = ConvertGameEvent(2)
470 constant gameevent EVENT_GAME_STATE_LIMIT = ConvertGameEvent(3)
471
472 constant gameevent EVENT_GAME_TIMER_EXPIRED = ConvertGameEvent(4)
473
474 constant gameevent EVENT_GAME_ENTER_REGION = ConvertGameEvent(5)
475 constant gameevent EVENT_GAME_LEAVE_REGION = ConvertGameEvent(6)
476
477 constant gameevent EVENT_GAME_TRACKABLE_HIT = ConvertGameEvent(7)
478 constant gameevent EVENT_GAME_TRACKABLE_TRACK = ConvertGameEvent(8)
479
480 constant gameevent EVENT_GAME_SHOW_SKILL = ConvertGameEvent(9)
481 constant gameevent EVENT_GAME_BUILD_SUBMENU = ConvertGameEvent(10)
482
483 //===================================================
484 // For use with TriggerRegisterPlayerEvent
485 //===================================================
486 constant playerevent EVENT_PLAYER_STATE_LIMIT = ConvertPlayerEvent(11)
487 constant playerevent EVENT_PLAYER_ALLIANCE_CHANGED = ConvertPlayerEvent(12)
488
489 constant playerevent EVENT_PLAYER_DEFEAT = ConvertPlayerEvent(13)
490 constant playerevent EVENT_PLAYER_VICTORY = ConvertPlayerEvent(14)
491 constant playerevent EVENT_PLAYER_LEAVE = ConvertPlayerEvent(15)
492 constant playerevent EVENT_PLAYER_CHAT = ConvertPlayerEvent(16)
493 constant playerevent EVENT_PLAYER_END_CINEMATIC = ConvertPlayerEvent(17)
494
495 //===================================================
496 // For use with TriggerRegisterPlayerUnitEvent
497 //===================================================
498
499 constant playerunitevent EVENT_PLAYER_UNIT_ATTACKED = ConvertPlayerUnitEvent(18)
500 constant playerunitevent EVENT_PLAYER_UNIT_RESCUED = ConvertPlayerUnitEvent(19)
501
502 constant playerunitevent EVENT_PLAYER_UNIT_DEATH = ConvertPlayerUnitEvent(20)
503 constant playerunitevent EVENT_PLAYER_UNIT_DECAY = ConvertPlayerUnitEvent(21)
504
505 constant playerunitevent EVENT_PLAYER_UNIT_DETECTED = ConvertPlayerUnitEvent(22)
506 constant playerunitevent EVENT_PLAYER_UNIT_HIDDEN = ConvertPlayerUnitEvent(23)
507
508 constant playerunitevent EVENT_PLAYER_UNIT_SELECTED = ConvertPlayerUnitEvent(24)
509 constant playerunitevent EVENT_PLAYER_UNIT_DESELECTED = ConvertPlayerUnitEvent(25)
510
511 constant playerunitevent EVENT_PLAYER_UNIT_CONSTRUCT_START = ConvertPlayerUnitEvent(26)
512 constant playerunitevent EVENT_PLAYER_UNIT_CONSTRUCT_CANCEL = ConvertPlayerUnitEvent(27)
513 constant playerunitevent EVENT_PLAYER_UNIT_CONSTRUCT_FINISH = ConvertPlayerUnitEvent(28)
514
515 constant playerunitevent EVENT_PLAYER_UNIT_UPGRADE_START = ConvertPlayerUnitEvent(29)
516 constant playerunitevent EVENT_PLAYER_UNIT_UPGRADE_CANCEL = ConvertPlayerUnitEvent(30)
517 constant playerunitevent EVENT_PLAYER_UNIT_UPGRADE_FINISH = ConvertPlayerUnitEvent(31)
518
519 constant playerunitevent EVENT_PLAYER_UNIT_TRAIN_START = ConvertPlayerUnitEvent(32)
520 constant playerunitevent EVENT_PLAYER_UNIT_TRAIN_CANCEL = ConvertPlayerUnitEvent(33)
521 constant playerunitevent EVENT_PLAYER_UNIT_TRAIN_FINISH = ConvertPlayerUnitEvent(34)
522
523 constant playerunitevent EVENT_PLAYER_UNIT_RESEARCH_START = ConvertPlayerUnitEvent(35)
524 constant playerunitevent EVENT_PLAYER_UNIT_RESEARCH_CANCEL = ConvertPlayerUnitEvent(36)
525 constant playerunitevent EVENT_PLAYER_UNIT_RESEARCH_FINISH = ConvertPlayerUnitEvent(37)
526 constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_ORDER = ConvertPlayerUnitEvent(38)
527 constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER = ConvertPlayerUnitEvent(39)
528 constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER = ConvertPlayerUnitEvent(40)
529 constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_UNIT_ORDER = ConvertPlayerUnitEvent(40) // for compat
530
531 constant playerunitevent EVENT_PLAYER_HERO_LEVEL = ConvertPlayerUnitEvent(41)
532 constant playerunitevent EVENT_PLAYER_HERO_SKILL = ConvertPlayerUnitEvent(42)
533
534 constant playerunitevent EVENT_PLAYER_HERO_REVIVABLE = ConvertPlayerUnitEvent(43)
535
536 constant playerunitevent EVENT_PLAYER_HERO_REVIVE_START = ConvertPlayerUnitEvent(44)
537 constant playerunitevent EVENT_PLAYER_HERO_REVIVE_CANCEL = ConvertPlayerUnitEvent(45)
538 constant playerunitevent EVENT_PLAYER_HERO_REVIVE_FINISH = ConvertPlayerUnitEvent(46)
539 constant playerunitevent EVENT_PLAYER_UNIT_SUMMON = ConvertPlayerUnitEvent(47)
540 constant playerunitevent EVENT_PLAYER_UNIT_DROP_ITEM = ConvertPlayerUnitEvent(48)
541 constant playerunitevent EVENT_PLAYER_UNIT_PICKUP_ITEM = ConvertPlayerUnitEvent(49)
542 constant playerunitevent EVENT_PLAYER_UNIT_USE_ITEM = ConvertPlayerUnitEvent(50)
543
544 constant playerunitevent EVENT_PLAYER_UNIT_LOADED = ConvertPlayerUnitEvent(51)
545
546 //===================================================
547 // For use with TriggerRegisterUnitEvent
548 //===================================================
549
550 constant unitevent EVENT_UNIT_DAMAGED = ConvertUnitEvent(52)
551 constant unitevent EVENT_UNIT_DEATH = ConvertUnitEvent(53)
552 constant unitevent EVENT_UNIT_DECAY = ConvertUnitEvent(54)
553 constant unitevent EVENT_UNIT_DETECTED = ConvertUnitEvent(55)
554 constant unitevent EVENT_UNIT_HIDDEN = ConvertUnitEvent(56)
555 constant unitevent EVENT_UNIT_SELECTED = ConvertUnitEvent(57)
556 constant unitevent EVENT_UNIT_DESELECTED = ConvertUnitEvent(58)
557
558 constant unitevent EVENT_UNIT_STATE_LIMIT = ConvertUnitEvent(59)
559
560 // Events which may have a filter for the "other unit"
561 //
562 constant unitevent EVENT_UNIT_ACQUIRED_TARGET = ConvertUnitEvent(60)
563 constant unitevent EVENT_UNIT_TARGET_IN_RANGE = ConvertUnitEvent(61)
564 constant unitevent EVENT_UNIT_ATTACKED = ConvertUnitEvent(62)
565 constant unitevent EVENT_UNIT_RESCUED = ConvertUnitEvent(63)
566
567 constant unitevent EVENT_UNIT_CONSTRUCT_CANCEL = ConvertUnitEvent(64)
568 constant unitevent EVENT_UNIT_CONSTRUCT_FINISH = ConvertUnitEvent(65)
569
570 constant unitevent EVENT_UNIT_UPGRADE_START = ConvertUnitEvent(66)
571 constant unitevent EVENT_UNIT_UPGRADE_CANCEL = ConvertUnitEvent(67)
572 constant unitevent EVENT_UNIT_UPGRADE_FINISH = ConvertUnitEvent(68)
573
574 // Events which involve the specified unit performing
575 // training of other units
576 //
577 constant unitevent EVENT_UNIT_TRAIN_START = ConvertUnitEvent(69)
578 constant unitevent EVENT_UNIT_TRAIN_CANCEL = ConvertUnitEvent(70)
579 constant unitevent EVENT_UNIT_TRAIN_FINISH = ConvertUnitEvent(71)
580
581 constant unitevent EVENT_UNIT_RESEARCH_START = ConvertUnitEvent(72)
582 constant unitevent EVENT_UNIT_RESEARCH_CANCEL = ConvertUnitEvent(73)
583 constant unitevent EVENT_UNIT_RESEARCH_FINISH = ConvertUnitEvent(74)
584
585 constant unitevent EVENT_UNIT_ISSUED_ORDER = ConvertUnitEvent(75)
586 constant unitevent EVENT_UNIT_ISSUED_POINT_ORDER = ConvertUnitEvent(76)
587 constant unitevent EVENT_UNIT_ISSUED_TARGET_ORDER = ConvertUnitEvent(77)
588
589 constant unitevent EVENT_UNIT_HERO_LEVEL = ConvertUnitEvent(78)
590 constant unitevent EVENT_UNIT_HERO_SKILL = ConvertUnitEvent(79)
591
592 constant unitevent EVENT_UNIT_HERO_REVIVABLE = ConvertUnitEvent(80)
593 constant unitevent EVENT_UNIT_HERO_REVIVE_START = ConvertUnitEvent(81)
594 constant unitevent EVENT_UNIT_HERO_REVIVE_CANCEL = ConvertUnitEvent(82)
595 constant unitevent EVENT_UNIT_HERO_REVIVE_FINISH = ConvertUnitEvent(83)
596
597 constant unitevent EVENT_UNIT_SUMMON = ConvertUnitEvent(84)
598
599 constant unitevent EVENT_UNIT_DROP_ITEM = ConvertUnitEvent(85)
600 constant unitevent EVENT_UNIT_PICKUP_ITEM = ConvertUnitEvent(86)
601 constant unitevent EVENT_UNIT_USE_ITEM = ConvertUnitEvent(87)
602
603 constant unitevent EVENT_UNIT_LOADED = ConvertUnitEvent(88)
604
605 constant widgetevent EVENT_WIDGET_DEATH = ConvertWidgetEvent(89)
606
607 constant dialogevent EVENT_DIALOG_BUTTON_CLICK = ConvertDialogEvent(90)
608 constant dialogevent EVENT_DIALOG_CLICK = ConvertDialogEvent(91)
609
610 //===================================================
611 // Frozen Throne Expansion Events
612 // Need to be added here to preserve compat
613 //===================================================
614
615 //===================================================
616 // For use with TriggerRegisterGameEvent
617 //===================================================
618
619 constant gameevent EVENT_GAME_LOADED = ConvertGameEvent(256)
620 constant gameevent EVENT_GAME_TOURNAMENT_FINISH_SOON = ConvertGameEvent(257)
621 constant gameevent EVENT_GAME_TOURNAMENT_FINISH_NOW = ConvertGameEvent(258)
622 constant gameevent EVENT_GAME_SAVE = ConvertGameEvent(259)
623
624 //===================================================
625 // For use with TriggerRegisterPlayerEvent
626 //===================================================
627
628 constant playerevent EVENT_PLAYER_ARROW_LEFT_DOWN = ConvertPlayerEvent(261)
629 constant playerevent EVENT_PLAYER_ARROW_LEFT_UP = ConvertPlayerEvent(262)
630 constant playerevent EVENT_PLAYER_ARROW_RIGHT_DOWN = ConvertPlayerEvent(263)
631 constant playerevent EVENT_PLAYER_ARROW_RIGHT_UP = ConvertPlayerEvent(264)
632 constant playerevent EVENT_PLAYER_ARROW_DOWN_DOWN = ConvertPlayerEvent(265)
633 constant playerevent EVENT_PLAYER_ARROW_DOWN_UP = ConvertPlayerEvent(266)
634 constant playerevent EVENT_PLAYER_ARROW_UP_DOWN = ConvertPlayerEvent(267)
635 constant playerevent EVENT_PLAYER_ARROW_UP_UP = ConvertPlayerEvent(268)
636
637 //===================================================
638 // For use with TriggerRegisterPlayerUnitEvent
639 //===================================================
640
641 constant playerunitevent EVENT_PLAYER_UNIT_SELL = ConvertPlayerUnitEvent(269)
642 constant playerunitevent EVENT_PLAYER_UNIT_CHANGE_OWNER = ConvertPlayerUnitEvent(270)
643 constant playerunitevent EVENT_PLAYER_UNIT_SELL_ITEM = ConvertPlayerUnitEvent(271)
644 constant playerunitevent EVENT_PLAYER_UNIT_SPELL_CHANNEL = ConvertPlayerUnitEvent(272)
645 constant playerunitevent EVENT_PLAYER_UNIT_SPELL_CAST = ConvertPlayerUnitEvent(273)
646 constant playerunitevent EVENT_PLAYER_UNIT_SPELL_EFFECT = ConvertPlayerUnitEvent(274)
647 constant playerunitevent EVENT_PLAYER_UNIT_SPELL_FINISH = ConvertPlayerUnitEvent(275)
648 constant playerunitevent EVENT_PLAYER_UNIT_SPELL_ENDCAST = ConvertPlayerUnitEvent(276)
649 constant playerunitevent EVENT_PLAYER_UNIT_PAWN_ITEM = ConvertPlayerUnitEvent(277)
650
651 //===================================================
652 // For use with TriggerRegisterUnitEvent
653 //===================================================
654
655 constant unitevent EVENT_UNIT_SELL = ConvertUnitEvent(286)
656 constant unitevent EVENT_UNIT_CHANGE_OWNER = ConvertUnitEvent(287)
657 constant unitevent EVENT_UNIT_SELL_ITEM = ConvertUnitEvent(288)
658 constant unitevent EVENT_UNIT_SPELL_CHANNEL = ConvertUnitEvent(289)
659 constant unitevent EVENT_UNIT_SPELL_CAST = ConvertUnitEvent(290)
660 constant unitevent EVENT_UNIT_SPELL_EFFECT = ConvertUnitEvent(291)
661 constant unitevent EVENT_UNIT_SPELL_FINISH = ConvertUnitEvent(292)
662 constant unitevent EVENT_UNIT_SPELL_ENDCAST = ConvertUnitEvent(293)
663 constant unitevent EVENT_UNIT_PAWN_ITEM = ConvertUnitEvent(294)
664
665 //===================================================
666 // Limit Event API constants
667 // variable, player state, game state, and unit state events
668 // ( do NOT change the order of these... )
669 //===================================================
670 constant limitop LESS_THAN = ConvertLimitOp(0)
671 constant limitop LESS_THAN_OR_EQUAL = ConvertLimitOp(1)
672 constant limitop EQUAL = ConvertLimitOp(2)
673 constant limitop GREATER_THAN_OR_EQUAL = ConvertLimitOp(3)
674 constant limitop GREATER_THAN = ConvertLimitOp(4)
675 constant limitop NOT_EQUAL = ConvertLimitOp(5)
676
677 //===================================================
678 // Unit Type Constants for use with IsUnitType()
679 //===================================================
680
681 constant unittype UNIT_TYPE_HERO = ConvertUnitType(0)
682 constant unittype UNIT_TYPE_DEAD = ConvertUnitType(1)
683 constant unittype UNIT_TYPE_STRUCTURE = ConvertUnitType(2)
684
685 constant unittype UNIT_TYPE_FLYING = ConvertUnitType(3)
686 constant unittype UNIT_TYPE_GROUND = ConvertUnitType(4)
687
688 constant unittype UNIT_TYPE_ATTACKS_FLYING = ConvertUnitType(5)
689 constant unittype UNIT_TYPE_ATTACKS_GROUND = ConvertUnitType(6)
690
691 constant unittype UNIT_TYPE_MELEE_ATTACKER = ConvertUnitType(7)
692 constant unittype UNIT_TYPE_RANGED_ATTACKER = ConvertUnitType(8)
693
694 constant unittype UNIT_TYPE_GIANT = ConvertUnitType(9)
695 constant unittype UNIT_TYPE_SUMMONED = ConvertUnitType(10)
696 constant unittype UNIT_TYPE_STUNNED = ConvertUnitType(11)
697 constant unittype UNIT_TYPE_PLAGUED = ConvertUnitType(12)
698 constant unittype UNIT_TYPE_SNARED = ConvertUnitType(13)
699
700 constant unittype UNIT_TYPE_UNDEAD = ConvertUnitType(14)
701 constant unittype UNIT_TYPE_MECHANICAL = ConvertUnitType(15)
702 constant unittype UNIT_TYPE_PEON = ConvertUnitType(16)
703 constant unittype UNIT_TYPE_SAPPER = ConvertUnitType(17)
704 constant unittype UNIT_TYPE_TOWNHALL = ConvertUnitType(18)
705 constant unittype UNIT_TYPE_ANCIENT = ConvertUnitType(19)
706
707 constant unittype UNIT_TYPE_TAUREN = ConvertUnitType(20)
708 constant unittype UNIT_TYPE_POISONED = ConvertUnitType(21)
709 constant unittype UNIT_TYPE_POLYMORPHED = ConvertUnitType(22)
710 constant unittype UNIT_TYPE_SLEEPING = ConvertUnitType(23)
711 constant unittype UNIT_TYPE_RESISTANT = ConvertUnitType(24)
712 constant unittype UNIT_TYPE_ETHEREAL = ConvertUnitType(25)
713 constant unittype UNIT_TYPE_MAGIC_IMMUNE = ConvertUnitType(26)
714
715 //===================================================
716 // Unit Type Constants for use with ChooseRandomItemEx()
717 //===================================================
718
719 constant itemtype ITEM_TYPE_PERMANENT = ConvertItemType(0)
720 constant itemtype ITEM_TYPE_CHARGED = ConvertItemType(1)
721 constant itemtype ITEM_TYPE_POWERUP = ConvertItemType(2)
722 constant itemtype ITEM_TYPE_ARTIFACT = ConvertItemType(3)
723 constant itemtype ITEM_TYPE_PURCHASABLE = ConvertItemType(4)
724 constant itemtype ITEM_TYPE_CAMPAIGN = ConvertItemType(5)
725 constant itemtype ITEM_TYPE_MISCELLANEOUS = ConvertItemType(6)
726 constant itemtype ITEM_TYPE_UNKNOWN = ConvertItemType(7)
727 constant itemtype ITEM_TYPE_ANY = ConvertItemType(8)
728
729 // Deprecated, should use ITEM_TYPE_POWERUP
730 constant itemtype ITEM_TYPE_TOME = ConvertItemType(2)
731
732 //===================================================
733 // Animatable Camera Fields
734 //===================================================
735
736 constant camerafield CAMERA_FIELD_TARGET_DISTANCE = ConvertCameraField(0)
737 constant camerafield CAMERA_FIELD_FARZ = ConvertCameraField(1)
738 constant camerafield CAMERA_FIELD_ANGLE_OF_ATTACK = ConvertCameraField(2)
739 constant camerafield CAMERA_FIELD_FIELD_OF_VIEW = ConvertCameraField(3)
740 constant camerafield CAMERA_FIELD_ROLL = ConvertCameraField(4)
741 constant camerafield CAMERA_FIELD_ROTATION = ConvertCameraField(5)
742 constant camerafield CAMERA_FIELD_ZOFFSET = ConvertCameraField(6)
743
744 constant blendmode BLEND_MODE_NONE = ConvertBlendMode(0)
745 constant blendmode BLEND_MODE_DONT_CARE = ConvertBlendMode(0)
746 constant blendmode BLEND_MODE_KEYALPHA = ConvertBlendMode(1)
747 constant blendmode BLEND_MODE_BLEND = ConvertBlendMode(2)
748 constant blendmode BLEND_MODE_ADDITIVE = ConvertBlendMode(3)
749 constant blendmode BLEND_MODE_MODULATE = ConvertBlendMode(4)
750 constant blendmode BLEND_MODE_MODULATE_2X = ConvertBlendMode(5)
751
752 constant raritycontrol RARITY_FREQUENT = ConvertRarityControl(0)
753 constant raritycontrol RARITY_RARE = ConvertRarityControl(1)
754
755 constant texmapflags TEXMAP_FLAG_NONE = ConvertTexMapFlags(0)
756 constant texmapflags TEXMAP_FLAG_WRAP_U = ConvertTexMapFlags(1)
757 constant texmapflags TEXMAP_FLAG_WRAP_V = ConvertTexMapFlags(2)
758 constant texmapflags TEXMAP_FLAG_WRAP_UV = ConvertTexMapFlags(3)
759
760 constant fogstate FOG_OF_WAR_MASKED = ConvertFogState(1)
761 constant fogstate FOG_OF_WAR_FOGGED = ConvertFogState(2)
762 constant fogstate FOG_OF_WAR_VISIBLE = ConvertFogState(4)
763
764 //===================================================
765 // Camera Margin constants for use with GetCameraMargin
766 //===================================================
767
768 constant integer CAMERA_MARGIN_LEFT = 0
769 constant integer CAMERA_MARGIN_RIGHT = 1
770 constant integer CAMERA_MARGIN_TOP = 2
771 constant integer CAMERA_MARGIN_BOTTOM = 3
772
773 //===================================================
774 // Effect API constants
775 //===================================================
776
777 constant effecttype EFFECT_TYPE_EFFECT = ConvertEffectType(0)
778 constant effecttype EFFECT_TYPE_TARGET = ConvertEffectType(1)
779 constant effecttype EFFECT_TYPE_CASTER = ConvertEffectType(2)
780 constant effecttype EFFECT_TYPE_SPECIAL = ConvertEffectType(3)
781 constant effecttype EFFECT_TYPE_AREA_EFFECT = ConvertEffectType(4)
782 constant effecttype EFFECT_TYPE_MISSILE = ConvertEffectType(5)
783 constant effecttype EFFECT_TYPE_LIGHTNING = ConvertEffectType(6)
784
785 constant soundtype SOUND_TYPE_EFFECT = ConvertSoundType(0)
786 constant soundtype SOUND_TYPE_EFFECT_LOOPED = ConvertSoundType(1)
787 endglobals
788
789 //============================================================================
790 // MathAPI
791 native Deg2Rad takes real degrees returns real
792 native Rad2Deg takes real radians returns real
793
794 native Sin takes real radians returns real
795 native Cos takes real radians returns real
796 native Tan takes real radians returns real
797
798 // Expect values between -1 and 1...returns 0 for invalid input
799 native Asin takes real y returns real
800 native Acos takes real x returns real
801
802 native Atan takes real x returns real
803
804 // Returns 0 if x and y are both 0
805 native Atan2 takes real y, real x returns real
806
807 // Returns 0 if x <= 0
808 native SquareRoot takes real x returns real
809
810 // computes x to the y power
811 // y == 0.0 => 1
812 // x ==0.0 and y < 0 => 0
813 //
814 native Pow takes real x, real power returns real
815
816 //============================================================================
817 // String Utility API
818 native I2R takes integer i returns real
819 native R2I takes real r returns integer
820 native I2S takes integer i returns string
821 native R2S takes real r returns string
822 native R2SW takes real r, integer width, integer precision returns string
823 native S2I takes string s returns integer
824 native S2R takes string s returns real
825 native GetHandleId takes handle h returns integer
826 native SubString takes string source, integer start, integer end returns string
827 native StringLength takes string s returns integer
828 native StringCase takes string source, boolean upper returns string
829 native StringHash takes string s returns integer
830
831 native GetLocalizedString takes string source returns string
832 native GetLocalizedHotkey takes string source returns integer
833
834 //============================================================================
835 // Map Setup API
836 //
837 // These are native functions for describing the map configuration
838 // these funcs should only be used in the "config" function of
839 // a map script. The functions should also be called in this order
840 // ( i.e. call SetPlayers before SetPlayerColor...
841 //
842
843 native SetMapName takes string name returns nothing
844 native SetMapDescription takes string description returns nothing
845
846 native SetTeams takes integer teamcount returns nothing
847 native SetPlayers takes integer playercount returns nothing
848
849 native DefineStartLocation takes integer whichStartLoc, real x, real y returns nothing
850 native DefineStartLocationLoc takes integer whichStartLoc, location whichLocation returns nothing
851 native SetStartLocPrioCount takes integer whichStartLoc, integer prioSlotCount returns nothing
852 native SetStartLocPrio takes integer whichStartLoc, integer prioSlotIndex, integer otherStartLocIndex, startlocprio priority returns nothing
853 native GetStartLocPrioSlot takes integer whichStartLoc, integer prioSlotIndex returns integer
854 native GetStartLocPrio takes integer whichStartLoc, integer prioSlotIndex returns startlocprio
855
856 native SetGameTypeSupported takes gametype whichGameType, boolean value returns nothing
857 native SetMapFlag takes mapflag whichMapFlag, boolean value returns nothing
858 native SetGamePlacement takes placement whichPlacementType returns nothing
859 native SetGameSpeed takes gamespeed whichspeed returns nothing
860 native SetGameDifficulty takes gamedifficulty whichdifficulty returns nothing
861 native SetResourceDensity takes mapdensity whichdensity returns nothing
862 native SetCreatureDensity takes mapdensity whichdensity returns nothing
863
864 native GetTeams takes nothing returns integer
865 native GetPlayers takes nothing returns integer
866
867 native IsGameTypeSupported takes gametype whichGameType returns boolean
868 native GetGameTypeSelected takes nothing returns gametype
869 native IsMapFlagSet takes mapflag whichMapFlag returns boolean
870
871 constant native GetGamePlacement takes nothing returns placement
872 constant native GetGameSpeed takes nothing returns gamespeed
873 constant native GetGameDifficulty takes nothing returns gamedifficulty
874 constant native GetResourceDensity takes nothing returns mapdensity
875 constant native GetCreatureDensity takes nothing returns mapdensity
876 constant native GetStartLocationX takes integer whichStartLocation returns real
877 constant native GetStartLocationY takes integer whichStartLocation returns real
878 constant native GetStartLocationLoc takes integer whichStartLocation returns location
879
880
881 native SetPlayerTeam takes player whichPlayer, integer whichTeam returns nothing
882 native SetPlayerStartLocation takes player whichPlayer, integer startLocIndex returns nothing
883 // forces player to have the specified start loc and marks the start loc as occupied
884 // which removes it from consideration for subsequently placed players
885 // ( i.e. you can use this to put people in a fixed loc and then
886 // use random placement for any unplaced players etc )
887 native ForcePlayerStartLocation takes player whichPlayer, integer startLocIndex returns nothing
888 native SetPlayerColor takes player whichPlayer, playercolor color returns nothing
889 native SetPlayerAlliance takes player sourcePlayer, player otherPlayer, alliancetype whichAllianceSetting, boolean value returns nothing
890 native SetPlayerTaxRate takes player sourcePlayer, player otherPlayer, playerstate whichResource, integer rate returns nothing
891 native SetPlayerRacePreference takes player whichPlayer, racepreference whichRacePreference returns nothing
892 native SetPlayerRaceSelectable takes player whichPlayer, boolean value returns nothing
893 native SetPlayerController takes player whichPlayer, mapcontrol controlType returns nothing
894 native SetPlayerName takes player whichPlayer, string name returns nothing
895
896 native SetPlayerOnScoreScreen takes player whichPlayer, boolean flag returns nothing
897
898 native GetPlayerTeam takes player whichPlayer returns integer
899 native GetPlayerStartLocation takes player whichPlayer returns integer
900 native GetPlayerColor takes player whichPlayer returns playercolor
901 native GetPlayerSelectable takes player whichPlayer returns boolean
902 native GetPlayerController takes player whichPlayer returns mapcontrol
903 native GetPlayerSlotState takes player whichPlayer returns playerslotstate
904 native GetPlayerTaxRate takes player sourcePlayer, player otherPlayer, playerstate whichResource returns integer
905 native IsPlayerRacePrefSet takes player whichPlayer, racepreference pref returns boolean
906 native GetPlayerName takes player whichPlayer returns string
907
908 //============================================================================
909 // Timer API
910 //
911 native CreateTimer takes nothing returns timer
912 native DestroyTimer takes timer whichTimer returns nothing
913 native TimerStart takes timer whichTimer, real timeout, boolean periodic, code handlerFunc returns nothing
914 native TimerGetElapsed takes timer whichTimer returns real
915 native TimerGetRemaining takes timer whichTimer returns real
916 native TimerGetTimeout takes timer whichTimer returns real
917 native PauseTimer takes timer whichTimer returns nothing
918 native ResumeTimer takes timer whichTimer returns nothing
919 native GetExpiredTimer takes nothing returns timer
920
921 //============================================================================
922 // Group API
923 //
924 native CreateGroup takes nothing returns group
925 native DestroyGroup takes group whichGroup returns nothing
926 native GroupAddUnit takes group whichGroup, unit whichUnit returns nothing
927 native GroupRemoveUnit takes group whichGroup, unit whichUnit returns nothing
928 native GroupClear takes group whichGroup returns nothing
929 native GroupEnumUnitsOfType takes group whichGroup, string unitname, boolexpr filter returns nothing
930 native GroupEnumUnitsOfPlayer takes group whichGroup, player whichPlayer, boolexpr filter returns nothing
931 native GroupEnumUnitsOfTypeCounted takes group whichGroup, string unitname, boolexpr filter, integer countLimit returns nothing
932 native GroupEnumUnitsInRect takes group whichGroup, rect r, boolexpr filter returns nothing
933 native GroupEnumUnitsInRectCounted takes group whichGroup, rect r, boolexpr filter, integer countLimit returns nothing
934 native GroupEnumUnitsInRange takes group whichGroup, real x, real y, real radius, boolexpr filter returns nothing
935 native GroupEnumUnitsInRangeOfLoc takes group whichGroup, location whichLocation, real radius, boolexpr filter returns nothing
936 native GroupEnumUnitsInRangeCounted takes group whichGroup, real x, real y, real radius, boolexpr filter, integer countLimit returns nothing
937 native GroupEnumUnitsInRangeOfLocCounted takes group whichGroup, location whichLocation, real radius, boolexpr filter, integer countLimit returns nothing
938 native GroupEnumUnitsSelected takes group whichGroup, player whichPlayer, boolexpr filter returns nothing
939
940 native GroupImmediateOrder takes group whichGroup, string order returns boolean
941 native GroupImmediateOrderById takes group whichGroup, integer order returns boolean
942 native GroupPointOrder takes group whichGroup, string order, real x, real y returns boolean
943 native GroupPointOrderLoc takes group whichGroup, string order, location whichLocation returns boolean
944 native GroupPointOrderById takes group whichGroup, integer order, real x, real y returns boolean
945 native GroupPointOrderByIdLoc takes group whichGroup, integer order, location whichLocation returns boolean
946 native GroupTargetOrder takes group whichGroup, string order, widget targetWidget returns boolean
947 native GroupTargetOrderById takes group whichGroup, integer order, widget targetWidget returns boolean
948
949 // This will be difficult to support with potentially disjoint, cell-based regions
950 // as it would involve enumerating all the cells that are covered by a particularregion
951 // a better implementation would be a trigger that adds relevant units as they enter
952 // and removes them if they leave...
953 native ForGroup takes group whichGroup, code callback returns nothing
954 native FirstOfGroup takes group whichGroup returns unit
955
956 //============================================================================
957 // Force API
958 //
959 native CreateForce takes nothing returns force
960 native DestroyForce takes force whichForce returns nothing
961 native ForceAddPlayer takes force whichForce, player whichPlayer returns nothing
962 native ForceRemovePlayer takes force whichForce, player whichPlayer returns nothing
963 native ForceClear takes force whichForce returns nothing
964 native ForceEnumPlayers takes force whichForce, boolexpr filter returns nothing
965 native ForceEnumPlayersCounted takes force whichForce, boolexpr filter, integer countLimit returns nothing
966 native ForceEnumAllies takes force whichForce, player whichPlayer, boolexpr filter returns nothing
967 native ForceEnumEnemies takes force whichForce, player whichPlayer, boolexpr filter returns nothing
968 native ForForce takes force whichForce, code callback returns nothing
969
970 //============================================================================
971 // Region and Location API
972 //
973 native Rect takes real minx, real miny, real maxx, real maxy returns rect
974 native RectFromLoc takes location min, location max returns rect
975 native RemoveRect takes rect whichRect returns nothing
976 native SetRect takes rect whichRect, real minx, real miny, real maxx, real maxy returns nothing
977 native SetRectFromLoc takes rect whichRect, location min, location max returns nothing
978 native MoveRectTo takes rect whichRect, real newCenterX, real newCenterY returns nothing
979 native MoveRectToLoc takes rect whichRect, location newCenterLoc returns nothing
980
981 native GetRectCenterX takes rect whichRect returns real
982 native GetRectCenterY takes rect whichRect returns real
983 native GetRectMinX takes rect whichRect returns real
984 native GetRectMinY takes rect whichRect returns real
985 native GetRectMaxX takes rect whichRect returns real
986 native GetRectMaxY takes rect whichRect returns real
987
988 native CreateRegion takes nothing returns region
989 native RemoveRegion takes region whichRegion returns nothing
990
991 native RegionAddRect takes region whichRegion, rect r returns nothing
992 native RegionClearRect takes region whichRegion, rect r returns nothing
993
994 native RegionAddCell takes region whichRegion, real x, real y returns nothing
995 native RegionAddCellAtLoc takes region whichRegion, location whichLocation returns nothing
996 native RegionClearCell takes region whichRegion, real x, real y returns nothing
997 native RegionClearCellAtLoc takes region whichRegion, location whichLocation returns nothing
998
999 native Location takes real x, real y returns location
1000 native RemoveLocation takes location whichLocation returns nothing
1001 native MoveLocation takes location whichLocation, real newX, real newY returns nothing
1002 native GetLocationX takes location whichLocation returns real
1003 native GetLocationY takes location whichLocation returns real
1004
1005 // This function is asynchronous. The values it returns are not guaranteed synchronous between each player.
1006 // If you attempt to use it in a synchronous manner, it may cause a desync.
1007 native GetLocationZ takes location whichLocation returns real
1008
1009 native IsUnitInRegion takes region whichRegion, unit whichUnit returns boolean
1010 native IsPointInRegion takes region whichRegion, real x, real y returns boolean
1011 native IsLocationInRegion takes region whichRegion, location whichLocation returns boolean
1012
1013 // Returns full map bounds, including unplayable borders, in world coordinates
1014 native GetWorldBounds takes nothing returns rect
1015
1016 //============================================================================
1017 // Native trigger interface
1018 //
1019 native CreateTrigger takes nothing returns trigger
1020 native DestroyTrigger takes trigger whichTrigger returns nothing
1021 native ResetTrigger takes trigger whichTrigger returns nothing
1022 native EnableTrigger takes trigger whichTrigger returns nothing
1023 native DisableTrigger takes trigger whichTrigger returns nothing
1024 native IsTriggerEnabled takes trigger whichTrigger returns boolean
1025
1026 native TriggerWaitOnSleeps takes trigger whichTrigger, boolean flag returns nothing
1027 native IsTriggerWaitOnSleeps takes trigger whichTrigger returns boolean
1028
1029 constant native GetFilterUnit takes nothing returns unit
1030 constant native GetEnumUnit takes nothing returns unit
1031
1032 constant native GetFilterDestructable takes nothing returns destructable
1033 constant native GetEnumDestructable takes nothing returns destructable
1034
1035 constant native GetFilterItem takes nothing returns item
1036 constant native GetEnumItem takes nothing returns item
1037
1038 constant native GetFilterPlayer takes nothing returns player
1039 constant native GetEnumPlayer takes nothing returns player
1040
1041 constant native GetTriggeringTrigger takes nothing returns trigger
1042 constant native GetTriggerEventId takes nothing returns eventid
1043 constant native GetTriggerEvalCount takes trigger whichTrigger returns integer
1044 constant native GetTriggerExecCount takes trigger whichTrigger returns integer
1045
1046 native ExecuteFunc takes string funcName returns nothing
1047
1048 //============================================================================
1049 // Boolean Expr API ( for compositing trigger conditions and unit filter funcs...)
1050 //============================================================================
1051 native And takes boolexpr operandA, boolexpr operandB returns boolexpr
1052 native Or takes boolexpr operandA, boolexpr operandB returns boolexpr
1053 native Not takes boolexpr operand returns boolexpr
1054 native Condition takes code func returns conditionfunc
1055 native DestroyCondition takes conditionfunc c returns nothing
1056 native Filter takes code func returns filterfunc
1057 native DestroyFilter takes filterfunc f returns nothing
1058 native DestroyBoolExpr takes boolexpr e returns nothing
1059
1060 //============================================================================
1061 // Trigger Game Event API
1062 //============================================================================
1063
1064 native TriggerRegisterVariableEvent takes trigger whichTrigger, string varName, limitop opcode, real limitval returns event
1065
1066 // EVENT_GAME_VARIABLE_LIMIT
1067 //constant native GetTriggeringVariableName takes nothing returns string
1068
1069 // Creates it's own timer and triggers when it expires
1070 native TriggerRegisterTimerEvent takes trigger whichTrigger, real timeout, boolean periodic returns event
1071
1072 // Triggers when the timer you tell it about expires
1073 native TriggerRegisterTimerExpireEvent takes trigger whichTrigger, timer t returns event
1074
1075 native TriggerRegisterGameStateEvent takes trigger whichTrigger, gamestate whichState, limitop opcode, real limitval returns event
1076
1077 native TriggerRegisterDialogEvent takes trigger whichTrigger, dialog whichDialog returns event
1078 native TriggerRegisterDialogButtonEvent takes trigger whichTrigger, button whichButton returns event
1079
1080 // EVENT_GAME_STATE_LIMIT
1081 constant native GetEventGameState takes nothing returns gamestate
1082
1083 native TriggerRegisterGameEvent takes trigger whichTrigger, gameevent whichGameEvent returns event
1084
1085 // EVENT_GAME_VICTORY
1086 constant native GetWinningPlayer takes nothing returns player
1087
1088
1089 native TriggerRegisterEnterRegion takes trigger whichTrigger, region whichRegion, boolexpr filter returns event
1090
1091 // EVENT_GAME_ENTER_REGION
1092 constant native GetTriggeringRegion takes nothing returns region
1093 constant native GetEnteringUnit takes nothing returns unit
1094
1095 // EVENT_GAME_LEAVE_REGION
1096
1097 native TriggerRegisterLeaveRegion takes trigger whichTrigger, region whichRegion, boolexpr filter returns event
1098 constant native GetLeavingUnit takes nothing returns unit
1099
1100 native TriggerRegisterTrackableHitEvent takes trigger whichTrigger, trackable t returns event
1101 native TriggerRegisterTrackableTrackEvent takes trigger whichTrigger, trackable t returns event
1102
1103 // EVENT_GAME_TRACKABLE_HIT
1104 // EVENT_GAME_TRACKABLE_TRACK
1105 constant native GetTriggeringTrackable takes nothing returns trackable
1106
1107 // EVENT_DIALOG_BUTTON_CLICK
1108 constant native GetClickedButton takes nothing returns button
1109 constant native GetClickedDialog takes nothing returns dialog
1110
1111 // EVENT_GAME_TOURNAMENT_FINISH_SOON
1112 constant native GetTournamentFinishSoonTimeRemaining takes nothing returns real
1113 constant native GetTournamentFinishNowRule takes nothing returns integer
1114 constant native GetTournamentFinishNowPlayer takes nothing returns player
1115 constant native GetTournamentScore takes player whichPlayer returns integer
1116
1117 // EVENT_GAME_SAVE
1118 constant native GetSaveBasicFilename takes nothing returns string
1119
1120 //============================================================================
1121 // Trigger Player Based Event API
1122 //============================================================================
1123
1124 native TriggerRegisterPlayerEvent takes trigger whichTrigger, player whichPlayer, playerevent whichPlayerEvent returns event
1125
1126 // EVENT_PLAYER_DEFEAT
1127 // EVENT_PLAYER_VICTORY
1128 constant native GetTriggerPlayer takes nothing returns player
1129
1130 native TriggerRegisterPlayerUnitEvent takes trigger whichTrigger, player whichPlayer, playerunitevent whichPlayerUnitEvent, boolexpr filter returns event
1131
1132 // EVENT_PLAYER_HERO_LEVEL
1133 // EVENT_UNIT_HERO_LEVEL
1134 constant native GetLevelingUnit takes nothing returns unit
1135
1136 // EVENT_PLAYER_HERO_SKILL
1137 // EVENT_UNIT_HERO_SKILL
1138 constant native GetLearningUnit takes nothing returns unit
1139 constant native GetLearnedSkill takes nothing returns integer
1140 constant native GetLearnedSkillLevel takes nothing returns integer
1141
1142 // EVENT_PLAYER_HERO_REVIVABLE
1143 constant native GetRevivableUnit takes nothing returns unit
1144
1145 // EVENT_PLAYER_HERO_REVIVE_START
1146 // EVENT_PLAYER_HERO_REVIVE_CANCEL
1147 // EVENT_PLAYER_HERO_REVIVE_FINISH
1148 // EVENT_UNIT_HERO_REVIVE_START
1149 // EVENT_UNIT_HERO_REVIVE_CANCEL
1150 // EVENT_UNIT_HERO_REVIVE_FINISH
1151 constant native GetRevivingUnit takes nothing returns unit
1152
1153 // EVENT_PLAYER_UNIT_ATTACKED
1154 constant native GetAttacker takes nothing returns unit
1155
1156 // EVENT_PLAYER_UNIT_RESCUED
1157 constant native GetRescuer takes nothing returns unit
1158
1159 // EVENT_PLAYER_UNIT_DEATH
1160 constant native GetDyingUnit takes nothing returns unit
1161 constant native GetKillingUnit takes nothing returns unit
1162
1163 // EVENT_PLAYER_UNIT_DECAY
1164 constant native GetDecayingUnit takes nothing returns unit
1165
1166 // EVENT_PLAYER_UNIT_SELECTED
1167 //constant native GetSelectedUnit takes nothing returns unit
1168
1169 // EVENT_PLAYER_UNIT_CONSTRUCT_START
1170 constant native GetConstructingStructure takes nothing returns unit
1171
1172 // EVENT_PLAYER_UNIT_CONSTRUCT_FINISH
1173 // EVENT_PLAYER_UNIT_CONSTRUCT_CANCEL
1174 constant native GetCancelledStructure takes nothing returns unit
1175 constant native GetConstructedStructure takes nothing returns unit
1176
1177 // EVENT_PLAYER_UNIT_RESEARCH_START
1178 // EVENT_PLAYER_UNIT_RESEARCH_CANCEL
1179 // EVENT_PLAYER_UNIT_RESEARCH_FINISH
1180 constant native GetResearchingUnit takes nothing returns unit
1181 constant native GetResearched takes nothing returns integer
1182
1183 // EVENT_PLAYER_UNIT_TRAIN_START
1184 // EVENT_PLAYER_UNIT_TRAIN_CANCEL
1185 constant native GetTrainedUnitType takes nothing returns integer
1186
1187 // EVENT_PLAYER_UNIT_TRAIN_FINISH
1188 constant native GetTrainedUnit takes nothing returns unit
1189
1190 // EVENT_PLAYER_UNIT_DETECTED
1191 constant native GetDetectedUnit takes nothing returns unit
1192
1193 // EVENT_PLAYER_UNIT_SUMMONED
1194 constant native GetSummoningUnit takes nothing returns unit
1195 constant native GetSummonedUnit takes nothing returns unit
1196
1197 // EVENT_PLAYER_UNIT_LOADED
1198 constant native GetTransportUnit takes nothing returns unit
1199 constant native GetLoadedUnit takes nothing returns unit
1200
1201 // EVENT_PLAYER_UNIT_SELL
1202 constant native GetSellingUnit takes nothing returns unit
1203 constant native GetSoldUnit takes nothing returns unit
1204 constant native GetBuyingUnit takes nothing returns unit
1205
1206 // EVENT_PLAYER_UNIT_SELL_ITEM
1207 constant native GetSoldItem takes nothing returns item
1208
1209 // EVENT_PLAYER_UNIT_CHANGE_OWNER
1210 constant native GetChangingUnit takes nothing returns unit
1211 constant native GetChangingUnitPrevOwner takes nothing returns player
1212
1213 // EVENT_PLAYER_UNIT_DROP_ITEM
1214 // EVENT_PLAYER_UNIT_PICKUP_ITEM
1215 // EVENT_PLAYER_UNIT_USE_ITEM
1216 constant native GetManipulatingUnit takes nothing returns unit
1217 constant native GetManipulatedItem takes nothing returns item
1218
1219 // EVENT_PLAYER_UNIT_ISSUED_ORDER
1220 constant native GetOrderedUnit takes nothing returns unit
1221 constant native GetIssuedOrderId takes nothing returns integer
1222
1223 // EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER
1224 constant native GetOrderPointX takes nothing returns real
1225 constant native GetOrderPointY takes nothing returns real
1226 constant native GetOrderPointLoc takes nothing returns location
1227
1228 // EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER
1229 constant native GetOrderTarget takes nothing returns widget
1230 constant native GetOrderTargetDestructable takes nothing returns destructable
1231 constant native GetOrderTargetItem takes nothing returns item
1232 constant native GetOrderTargetUnit takes nothing returns unit
1233
1234 // EVENT_UNIT_SPELL_CHANNEL
1235 // EVENT_UNIT_SPELL_CAST
1236 // EVENT_UNIT_SPELL_EFFECT
1237 // EVENT_UNIT_SPELL_FINISH
1238 // EVENT_UNIT_SPELL_ENDCAST
1239 // EVENT_PLAYER_UNIT_SPELL_CHANNEL
1240 // EVENT_PLAYER_UNIT_SPELL_CAST
1241 // EVENT_PLAYER_UNIT_SPELL_EFFECT
1242 // EVENT_PLAYER_UNIT_SPELL_FINISH
1243 // EVENT_PLAYER_UNIT_SPELL_ENDCAST
1244 constant native GetSpellAbilityUnit takes nothing returns unit
1245 constant native GetSpellAbilityId takes nothing returns integer
1246 constant native GetSpellAbility takes nothing returns ability
1247 constant native GetSpellTargetLoc takes nothing returns location
1248 constant native GetSpellTargetX takes nothing returns real
1249 constant native GetSpellTargetY takes nothing returns real
1250 constant native GetSpellTargetDestructable takes nothing returns destructable
1251 constant native GetSpellTargetItem takes nothing returns item
1252 constant native GetSpellTargetUnit takes nothing returns unit
1253
1254 native TriggerRegisterPlayerAllianceChange takes trigger whichTrigger, player whichPlayer, alliancetype whichAlliance returns event
1255 native TriggerRegisterPlayerStateEvent takes trigger whichTrigger, player whichPlayer, playerstate whichState, limitop opcode, real limitval returns event
1256
1257 // EVENT_PLAYER_STATE_LIMIT
1258 constant native GetEventPlayerState takes nothing returns playerstate
1259
1260 native TriggerRegisterPlayerChatEvent takes trigger whichTrigger, player whichPlayer, string chatMessageToDetect, boolean exactMatchOnly returns event
1261
1262 // EVENT_PLAYER_CHAT
1263
1264 // returns the actual string they typed in ( same as what you registered for
1265 // if you required exact match )
1266 constant native GetEventPlayerChatString takes nothing returns string
1267
1268 // returns the string that you registered for
1269 constant native GetEventPlayerChatStringMatched takes nothing returns string
1270
1271 native TriggerRegisterDeathEvent takes trigger whichTrigger, widget whichWidget returns event
1272
1273 //============================================================================
1274 // Trigger Unit Based Event API
1275 //============================================================================
1276
1277 // returns handle to unit which triggered the most recent event when called from
1278 // within a trigger action function...returns null handle when used incorrectly
1279
1280 constant native GetTriggerUnit takes nothing returns unit
1281
1282 native TriggerRegisterUnitStateEvent takes trigger whichTrigger, unit whichUnit, unitstate whichState, limitop opcode, real limitval returns event
1283
1284 // EVENT_UNIT_STATE_LIMIT
1285 constant native GetEventUnitState takes nothing returns unitstate
1286
1287 native TriggerRegisterUnitEvent takes trigger whichTrigger, unit whichUnit, unitevent whichEvent returns event
1288
1289 // EVENT_UNIT_DAMAGED
1290 constant native GetEventDamage takes nothing returns real
1291 constant native GetEventDamageSource takes nothing returns unit
1292
1293 // EVENT_UNIT_DEATH
1294 // EVENT_UNIT_DECAY
1295 // Use the GetDyingUnit and GetDecayingUnit funcs above
1296
1297 // EVENT_UNIT_DETECTED
1298 constant native GetEventDetectingPlayer takes nothing returns player
1299
1300 native TriggerRegisterFilterUnitEvent takes trigger whichTrigger, unit whichUnit, unitevent whichEvent, boolexpr filter returns event
1301
1302 // EVENT_UNIT_ACQUIRED_TARGET
1303 // EVENT_UNIT_TARGET_IN_RANGE
1304 constant native GetEventTargetUnit takes nothing returns unit
1305
1306 // EVENT_UNIT_ATTACKED
1307 // Use GetAttacker from the Player Unit Event API Below...
1308
1309 // EVENT_UNIT_RESCUEDED
1310 // Use GetRescuer from the Player Unit Event API Below...
1311
1312 // EVENT_UNIT_CONSTRUCT_CANCEL
1313 // EVENT_UNIT_CONSTRUCT_FINISH
1314
1315 // See the Player Unit Construction Event API above for event info funcs
1316
1317 // EVENT_UNIT_TRAIN_START
1318 // EVENT_UNIT_TRAIN_CANCELLED
1319 // EVENT_UNIT_TRAIN_FINISH
1320
1321 // See the Player Unit Training Event API above for event info funcs
1322
1323 // EVENT_UNIT_SELL
1324
1325 // See the Player Unit Sell Event API above for event info funcs
1326
1327 // EVENT_UNIT_DROP_ITEM
1328 // EVENT_UNIT_PICKUP_ITEM
1329 // EVENT_UNIT_USE_ITEM
1330 // See the Player Unit/Item manipulation Event API above for event info funcs
1331
1332 // EVENT_UNIT_ISSUED_ORDER
1333 // EVENT_UNIT_ISSUED_POINT_ORDER
1334 // EVENT_UNIT_ISSUED_TARGET_ORDER
1335
1336 // See the Player Unit Order Event API above for event info funcs
1337
1338 native TriggerRegisterUnitInRange takes trigger whichTrigger, unit whichUnit, real range, boolexpr filter returns event
1339
1340 native TriggerAddCondition takes trigger whichTrigger, boolexpr condition returns triggercondition
1341 native TriggerRemoveCondition takes trigger whichTrigger, triggercondition whichCondition returns nothing
1342 native TriggerClearConditions takes trigger whichTrigger returns nothing
1343
1344 native TriggerAddAction takes trigger whichTrigger, code actionFunc returns triggeraction
1345 native TriggerRemoveAction takes trigger whichTrigger, triggeraction whichAction returns nothing
1346 native TriggerClearActions takes trigger whichTrigger returns nothing
1347 native TriggerSleepAction takes real timeout returns nothing
1348 native TriggerWaitForSound takes sound s, real offset returns nothing
1349 native TriggerEvaluate takes trigger whichTrigger returns boolean
1350 native TriggerExecute takes trigger whichTrigger returns nothing
1351 native TriggerExecuteWait takes trigger whichTrigger returns nothing
1352 native TriggerSyncStart takes nothing returns nothing
1353 native TriggerSyncReady takes nothing returns nothing
1354
1355 //============================================================================
1356 // Widget API
1357 native GetWidgetLife takes widget whichWidget returns real
1358 native SetWidgetLife takes widget whichWidget, real newLife returns nothing
1359 native GetWidgetX takes widget whichWidget returns real
1360 native GetWidgetY takes widget whichWidget returns real
1361 constant native GetTriggerWidget takes nothing returns widget
1362
1363 //============================================================================
1364 // Destructable Object API
1365 // Facing arguments are specified in degrees
1366 native CreateDestructable takes integer objectid, real x, real y, real face, real scale, integer variation returns destructable
1367 native CreateDestructableZ takes integer objectid, real x, real y, real z, real face, real scale, integer variation returns destructable
1368 native CreateDeadDestructable takes integer objectid, real x, real y, real face, real scale, integer variation returns destructable
1369 native CreateDeadDestructableZ takes integer objectid, real x, real y, real z, real face, real scale, integer variation returns destructable
1370 native RemoveDestructable takes destructable d returns nothing
1371 native KillDestructable takes destructable d returns nothing
1372 native SetDestructableInvulnerable takes destructable d, boolean flag returns nothing
1373 native IsDestructableInvulnerable takes destructable d returns boolean
1374 native EnumDestructablesInRect takes rect r, boolexpr filter, code actionFunc returns nothing
1375 native GetDestructableTypeId takes destructable d returns integer
1376 native GetDestructableX takes destructable d returns real
1377 native GetDestructableY takes destructable d returns real
1378 native SetDestructableLife takes destructable d, real life returns nothing
1379 native GetDestructableLife takes destructable d returns real
1380 native SetDestructableMaxLife takes destructable d, real max returns nothing
1381 native GetDestructableMaxLife takes destructable d returns real
1382 native DestructableRestoreLife takes destructable d, real life, boolean birth returns nothing
1383 native QueueDestructableAnimation takes destructable d, string whichAnimation returns nothing
1384 native SetDestructableAnimation takes destructable d, string whichAnimation returns nothing
1385 native SetDestructableAnimationSpeed takes destructable d, real speedFactor returns nothing
1386 native ShowDestructable takes destructable d, boolean flag returns nothing
1387 native GetDestructableOccluderHeight takes destructable d returns real
1388 native SetDestructableOccluderHeight takes destructable d, real height returns nothing
1389 native GetDestructableName takes destructable d returns string
1390
1391 //============================================================================
1392 // Item API
1393 native CreateItem takes integer itemid, real x, real y returns item
1394 native RemoveItem takes item whichItem returns nothing
1395 native GetItemPlayer takes item whichItem returns player
1396 native GetItemTypeId takes item i returns integer
1397 native GetItemX takes item i returns real
1398 native GetItemY takes item i returns real
1399 native SetItemPosition takes item i, real x, real y returns nothing
1400 native SetItemDropOnDeath takes item whichItem, boolean flag returns nothing
1401 native SetItemDroppable takes item i, boolean flag returns nothing
1402 native SetItemPawnable takes item i, boolean flag returns nothing
1403 native SetItemPlayer takes item whichItem, player whichPlayer, boolean changeColor returns nothing
1404 native SetItemInvulnerable takes item whichItem, boolean flag returns nothing
1405 native IsItemInvulnerable takes item whichItem returns boolean
1406 native SetItemVisible takes item whichItem, boolean show returns nothing
1407 native IsItemVisible takes item whichItem returns boolean
1408 native IsItemOwned takes item whichItem returns boolean
1409 native IsItemPowerup takes item whichItem returns boolean
1410 native IsItemSellable takes item whichItem returns boolean
1411 native IsItemPawnable takes item whichItem returns boolean
1412 native IsItemIdPowerup takes integer itemId returns boolean
1413 native IsItemIdSellable takes integer itemId returns boolean
1414 native IsItemIdPawnable takes integer itemId returns boolean
1415 native EnumItemsInRect takes rect r, boolexpr filter, code actionFunc returns nothing
1416 native GetItemLevel takes item whichItem returns integer
1417 native GetItemType takes item whichItem returns itemtype
1418 native SetItemDropID takes item whichItem, integer unitId returns nothing
1419 constant native GetItemName takes item whichItem returns string
1420 native GetItemCharges takes item whichItem returns integer
1421 native SetItemCharges takes item whichItem, integer charges returns nothing
1422 native GetItemUserData takes item whichItem returns integer
1423 native SetItemUserData takes item whichItem, integer data returns nothing
1424
1425 //============================================================================
1426 // Unit API
1427 // Facing arguments are specified in degrees
1428 native CreateUnit takes player id, integer unitid, real x, real y, real face returns unit
1429 native CreateUnitByName takes player whichPlayer, string unitname, real x, real y, real face returns unit
1430 native CreateUnitAtLoc takes player id, integer unitid, location whichLocation, real face returns unit
1431 native CreateUnitAtLocByName takes player id, string unitname, location whichLocation, real face returns unit
1432 native CreateCorpse takes player whichPlayer, integer unitid, real x, real y, real face returns unit
1433
1434 native KillUnit takes unit whichUnit returns nothing
1435 native RemoveUnit takes unit whichUnit returns nothing
1436 native ShowUnit takes unit whichUnit, boolean show returns nothing
1437
1438 native SetUnitState takes unit whichUnit, unitstate whichUnitState, real newVal returns nothing
1439 native SetUnitX takes unit whichUnit, real newX returns nothing
1440 native SetUnitY takes unit whichUnit, real newY returns nothing
1441 native SetUnitPosition takes unit whichUnit, real newX, real newY returns nothing
1442 native SetUnitPositionLoc takes unit whichUnit, location whichLocation returns nothing
1443 native SetUnitFacing takes unit whichUnit, real facingAngle returns nothing
1444 native SetUnitFacingTimed takes unit whichUnit, real facingAngle, real duration returns nothing
1445 native SetUnitMoveSpeed takes unit whichUnit, real newSpeed returns nothing
1446 native SetUnitFlyHeight takes unit whichUnit, real newHeight, real rate returns nothing
1447 native SetUnitTurnSpeed takes unit whichUnit, real newTurnSpeed returns nothing
1448 native SetUnitPropWindow takes unit whichUnit, real newPropWindowAngle returns nothing
1449 native SetUnitAcquireRange takes unit whichUnit, real newAcquireRange returns nothing
1450 native SetUnitCreepGuard takes unit whichUnit, boolean creepGuard returns nothing
1451
1452 native GetUnitAcquireRange takes unit whichUnit returns real
1453 native GetUnitTurnSpeed takes unit whichUnit returns real
1454 native GetUnitPropWindow takes unit whichUnit returns real
1455 native GetUnitFlyHeight takes unit whichUnit returns real
1456
1457 native GetUnitDefaultAcquireRange takes unit whichUnit returns real
1458 native GetUnitDefaultTurnSpeed takes unit whichUnit returns real
1459 native GetUnitDefaultPropWindow takes unit whichUnit returns real
1460 native GetUnitDefaultFlyHeight takes unit whichUnit returns real
1461
1462 native SetUnitOwner takes unit whichUnit, player whichPlayer, boolean changeColor returns nothing
1463 native SetUnitColor takes unit whichUnit, playercolor whichColor returns nothing
1464
1465 native SetUnitScale takes unit whichUnit, real scaleX, real scaleY, real scaleZ returns nothing
1466 native SetUnitTimeScale takes unit whichUnit, real timeScale returns nothing
1467 native SetUnitBlendTime takes unit whichUnit, real blendTime returns nothing
1468 native SetUnitVertexColor takes unit whichUnit, integer red, integer green, integer blue, integer alpha returns nothing
1469
1470 native QueueUnitAnimation takes unit whichUnit, string whichAnimation returns nothing
1471 native SetUnitAnimation takes unit whichUnit, string whichAnimation returns nothing
1472 native SetUnitAnimationByIndex takes unit whichUnit, integer whichAnimation returns nothing
1473 native SetUnitAnimationWithRarity takes unit whichUnit, string whichAnimation, raritycontrol rarity returns nothing
1474 native AddUnitAnimationProperties takes unit whichUnit, string animProperties, boolean add returns nothing
1475
1476 native SetUnitLookAt takes unit whichUnit, string whichBone, unit lookAtTarget, real offsetX, real offsetY, real offsetZ returns nothing
1477 native ResetUnitLookAt takes unit whichUnit returns nothing
1478
1479 native SetUnitRescuable takes unit whichUnit, player byWhichPlayer, boolean flag returns nothing
1480 native SetUnitRescueRange takes unit whichUnit, real range returns nothing
1481
1482 native SetHeroStr takes unit whichHero, integer newStr, boolean permanent returns nothing
1483 native SetHeroAgi takes unit whichHero, integer newAgi, boolean permanent returns nothing
1484 native SetHeroInt takes unit whichHero, integer newInt, boolean permanent returns nothing
1485
1486 native GetHeroStr takes unit whichHero, boolean includeBonuses returns integer
1487 native GetHeroAgi takes unit whichHero, boolean includeBonuses returns integer
1488 native GetHeroInt takes unit whichHero, boolean includeBonuses returns integer
1489
1490 native UnitStripHeroLevel takes unit whichHero, integer howManyLevels returns boolean
1491
1492 native GetHeroXP takes unit whichHero returns integer
1493 native SetHeroXP takes unit whichHero, integer newXpVal, boolean showEyeCandy returns nothing
1494
1495 native GetHeroSkillPoints takes unit whichHero returns integer
1496 native UnitModifySkillPoints takes unit whichHero, integer skillPointDelta returns boolean
1497
1498 native AddHeroXP takes unit whichHero, integer xpToAdd, boolean showEyeCandy returns nothing
1499 native SetHeroLevel takes unit whichHero, integer level, boolean showEyeCandy returns nothing
1500 constant native GetHeroLevel takes unit whichHero returns integer
1501 constant native GetUnitLevel takes unit whichUnit returns integer
1502 native GetHeroProperName takes unit whichHero returns string
1503 native SuspendHeroXP takes unit whichHero, boolean flag returns nothing
1504 native IsSuspendedXP takes unit whichHero returns boolean
1505 native SelectHeroSkill takes unit whichHero, integer abilcode returns nothing
1506 native GetUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer
1507 native DecUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer
1508 native IncUnitAbilityLevel takes unit whichUnit, integer abilcode returns integer
1509 native SetUnitAbilityLevel takes unit whichUnit, integer abilcode, integer level returns integer
1510 native ReviveHero takes unit whichHero, real x, real y, boolean doEyecandy returns boolean
1511 native ReviveHeroLoc takes unit whichHero, location loc, boolean doEyecandy returns boolean
1512 native SetUnitExploded takes unit whichUnit, boolean exploded returns nothing
1513 native SetUnitInvulnerable takes unit whichUnit, boolean flag returns nothing
1514 native PauseUnit takes unit whichUnit, boolean flag returns nothing
1515 native IsUnitPaused takes unit whichHero returns boolean
1516 native SetUnitPathing takes unit whichUnit, boolean flag returns nothing
1517
1518 native ClearSelection takes nothing returns nothing
1519 native SelectUnit takes unit whichUnit, boolean flag returns nothing
1520
1521 native GetUnitPointValue takes unit whichUnit returns integer
1522 native GetUnitPointValueByType takes integer unitType returns integer
1523 //native SetUnitPointValueByType takes integer unitType, integer newPointValue returns nothing
1524
1525 native UnitAddItem takes unit whichUnit, item whichItem returns boolean
1526 native UnitAddItemById takes unit whichUnit, integer itemId returns item
1527 native UnitAddItemToSlotById takes unit whichUnit, integer itemId, integer itemSlot returns boolean
1528 native UnitRemoveItem takes unit whichUnit, item whichItem returns nothing
1529 native UnitRemoveItemFromSlot takes unit whichUnit, integer itemSlot returns item
1530 native UnitHasItem takes unit whichUnit, item whichItem returns boolean
1531 native UnitItemInSlot takes unit whichUnit, integer itemSlot returns item
1532 native UnitInventorySize takes unit whichUnit returns integer
1533
1534 native UnitDropItemPoint takes unit whichUnit, item whichItem, real x, real y returns boolean
1535 native UnitDropItemSlot takes unit whichUnit, item whichItem, integer slot returns boolean
1536 native UnitDropItemTarget takes unit whichUnit, item whichItem, widget target returns boolean
1537
1538 native UnitUseItem takes unit whichUnit, item whichItem returns boolean
1539 native UnitUseItemPoint takes unit whichUnit, item whichItem, real x, real y returns boolean
1540 native UnitUseItemTarget takes unit whichUnit, item whichItem, widget target returns boolean
1541
1542 constant native GetUnitX takes unit whichUnit returns real
1543 constant native GetUnitY takes unit whichUnit returns real
1544 constant native GetUnitLoc takes unit whichUnit returns location
1545 constant native GetUnitFacing takes unit whichUnit returns real
1546 constant native GetUnitMoveSpeed takes unit whichUnit returns real
1547 constant native GetUnitDefaultMoveSpeed takes unit whichUnit returns real
1548 constant native GetUnitState takes unit whichUnit, unitstate whichUnitState returns real
1549 constant native GetOwningPlayer takes unit whichUnit returns player
1550 constant native GetUnitTypeId takes unit whichUnit returns integer
1551 constant native GetUnitRace takes unit whichUnit returns race
1552 constant native GetUnitName takes unit whichUnit returns string
1553 constant native GetUnitFoodUsed takes unit whichUnit returns integer
1554 constant native GetUnitFoodMade takes unit whichUnit returns integer
1555 constant native GetFoodMade takes integer unitId returns integer
1556 constant native GetFoodUsed takes integer unitId returns integer
1557 native SetUnitUseFood takes unit whichUnit, boolean useFood returns nothing
1558
1559 constant native GetUnitRallyPoint takes unit whichUnit returns location
1560 constant native GetUnitRallyUnit takes unit whichUnit returns unit
1561 constant native GetUnitRallyDestructable takes unit whichUnit returns destructable
1562
1563 constant native IsUnitInGroup takes unit whichUnit, group whichGroup returns boolean
1564 constant native IsUnitInForce takes unit whichUnit, force whichForce returns boolean
1565 constant native IsUnitOwnedByPlayer takes unit whichUnit, player whichPlayer returns boolean
1566 constant native IsUnitAlly takes unit whichUnit, player whichPlayer returns boolean
1567 constant native IsUnitEnemy takes unit whichUnit, player whichPlayer returns boolean
1568 constant native IsUnitVisible takes unit whichUnit, player whichPlayer returns boolean
1569 constant native IsUnitDetected takes unit whichUnit, player whichPlayer returns boolean
1570 constant native IsUnitInvisible takes unit whichUnit, player whichPlayer returns boolean
1571 constant native IsUnitFogged takes unit whichUnit, player whichPlayer returns boolean
1572 constant native IsUnitMasked takes unit whichUnit, player whichPlayer returns boolean
1573 constant native IsUnitSelected takes unit whichUnit, player whichPlayer returns boolean
1574 constant native IsUnitRace takes unit whichUnit, race whichRace returns boolean
1575 constant native IsUnitType takes unit whichUnit, unittype whichUnitType returns boolean
1576 constant native IsUnit takes unit whichUnit, unit whichSpecifiedUnit returns boolean
1577 constant native IsUnitInRange takes unit whichUnit, unit otherUnit, real distance returns boolean
1578 constant native IsUnitInRangeXY takes unit whichUnit, real x, real y, real distance returns boolean
1579 constant native IsUnitInRangeLoc takes unit whichUnit, location whichLocation, real distance returns boolean
1580 constant native IsUnitHidden takes unit whichUnit returns boolean
1581 constant native IsUnitIllusion takes unit whichUnit returns boolean
1582
1583 constant native IsUnitInTransport takes unit whichUnit, unit whichTransport returns boolean
1584 constant native IsUnitLoaded takes unit whichUnit returns boolean
1585
1586 constant native IsHeroUnitId takes integer unitId returns boolean
1587 constant native IsUnitIdType takes integer unitId, unittype whichUnitType returns boolean
1588
1589 native UnitShareVision takes unit whichUnit, player whichPlayer, boolean share returns nothing
1590 native UnitSuspendDecay takes unit whichUnit, boolean suspend returns nothing
1591 native UnitAddType takes unit whichUnit, unittype whichUnitType returns boolean
1592 native UnitRemoveType takes unit whichUnit, unittype whichUnitType returns boolean
1593
1594 native UnitAddAbility takes unit whichUnit, integer abilityId returns boolean
1595 native UnitRemoveAbility takes unit whichUnit, integer abilityId returns boolean
1596 native UnitMakeAbilityPermanent takes unit whichUnit, boolean permanent, integer abilityId returns boolean
1597 native UnitRemoveBuffs takes unit whichUnit, boolean removePositive, boolean removeNegative returns nothing
1598 native UnitRemoveBuffsEx takes unit whichUnit, boolean removePositive, boolean removeNegative, boolean magic, boolean physical, boolean timedLife, boolean aura, boolean autoDispel returns nothing
1599 native UnitHasBuffsEx takes unit whichUnit, boolean removePositive, boolean removeNegative, boolean magic, boolean physical, boolean timedLife, boolean aura, boolean autoDispel returns boolean
1600 native UnitCountBuffsEx takes unit whichUnit, boolean removePositive, boolean removeNegative, boolean magic, boolean physical, boolean timedLife, boolean aura, boolean autoDispel returns integer
1601 native UnitAddSleep takes unit whichUnit, boolean add returns nothing
1602 native UnitCanSleep takes unit whichUnit returns boolean
1603 native UnitAddSleepPerm takes unit whichUnit, boolean add returns nothing
1604 native UnitCanSleepPerm takes unit whichUnit returns boolean
1605 native UnitIsSleeping takes unit whichUnit returns boolean
1606 native UnitWakeUp takes unit whichUnit returns nothing
1607 native UnitApplyTimedLife takes unit whichUnit, integer buffId, real duration returns nothing
1608 native UnitIgnoreAlarm takes unit whichUnit, boolean flag returns boolean
1609 native UnitIgnoreAlarmToggled takes unit whichUnit returns boolean
1610 native UnitResetCooldown takes unit whichUnit returns nothing
1611 native UnitSetConstructionProgress takes unit whichUnit, integer constructionPercentage returns nothing
1612 native UnitSetUpgradeProgress takes unit whichUnit, integer upgradePercentage returns nothing
1613 native UnitPauseTimedLife takes unit whichUnit, boolean flag returns nothing
1614 native UnitSetUsesAltIcon takes unit whichUnit, boolean flag returns nothing
1615
1616 native UnitDamagePoint takes unit whichUnit, real delay, real radius, real x, real y, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns boolean
1617 native UnitDamageTarget takes unit whichUnit, widget target, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns boolean
1618
1619 native IssueImmediateOrder takes unit whichUnit, string order returns boolean
1620 native IssueImmediateOrderById takes unit whichUnit, integer order returns boolean
1621 native IssuePointOrder takes unit whichUnit, string order, real x, real y returns boolean
1622 native IssuePointOrderLoc takes unit whichUnit, string order, location whichLocation returns boolean
1623 native IssuePointOrderById takes unit whichUnit, integer order, real x, real y returns boolean
1624 native IssuePointOrderByIdLoc takes unit whichUnit, integer order, location whichLocation returns boolean
1625 native IssueTargetOrder takes unit whichUnit, string order, widget targetWidget returns boolean
1626 native IssueTargetOrderById takes unit whichUnit, integer order, widget targetWidget returns boolean
1627 native IssueInstantPointOrder takes unit whichUnit, string order, real x, real y, widget instantTargetWidget returns boolean
1628 native IssueInstantPointOrderById takes unit whichUnit, integer order, real x, real y, widget instantTargetWidget returns boolean
1629 native IssueInstantTargetOrder takes unit whichUnit, string order, widget targetWidget, widget instantTargetWidget returns boolean
1630 native IssueInstantTargetOrderById takes unit whichUnit, integer order, widget targetWidget, widget instantTargetWidget returns boolean
1631 native IssueBuildOrder takes unit whichPeon, string unitToBuild, real x, real y returns boolean
1632 native IssueBuildOrderById takes unit whichPeon, integer unitId, real x, real y returns boolean
1633
1634 native IssueNeutralImmediateOrder takes player forWhichPlayer, unit neutralStructure, string unitToBuild returns boolean
1635 native IssueNeutralImmediateOrderById takes player forWhichPlayer,unit neutralStructure, integer unitId returns boolean
1636 native IssueNeutralPointOrder takes player forWhichPlayer,unit neutralStructure, string unitToBuild, real x, real y returns boolean
1637 native IssueNeutralPointOrderById takes player forWhichPlayer,unit neutralStructure, integer unitId, real x, real y returns boolean
1638 native IssueNeutralTargetOrder takes player forWhichPlayer,unit neutralStructure, string unitToBuild, widget target returns boolean
1639 native IssueNeutralTargetOrderById takes player forWhichPlayer,unit neutralStructure, integer unitId, widget target returns boolean
1640
1641 native GetUnitCurrentOrder takes unit whichUnit returns integer
1642
1643 native SetResourceAmount takes unit whichUnit, integer amount returns nothing
1644 native AddResourceAmount takes unit whichUnit, integer amount returns nothing
1645 native GetResourceAmount takes unit whichUnit returns integer
1646
1647 native WaygateGetDestinationX takes unit waygate returns real
1648 native WaygateGetDestinationY takes unit waygate returns real
1649 native WaygateSetDestination takes unit waygate, real x, real y returns nothing
1650 native WaygateActivate takes unit waygate, boolean activate returns nothing
1651 native WaygateIsActive takes unit waygate returns boolean
1652
1653 native AddItemToAllStock takes integer itemId, integer currentStock, integer stockMax returns nothing
1654 native AddItemToStock takes unit whichUnit, integer itemId, integer currentStock, integer stockMax returns nothing
1655 native AddUnitToAllStock takes integer unitId, integer currentStock, integer stockMax returns nothing
1656 native AddUnitToStock takes unit whichUnit, integer unitId, integer currentStock, integer stockMax returns nothing
1657
1658 native RemoveItemFromAllStock takes integer itemId returns nothing
1659 native RemoveItemFromStock takes unit whichUnit, integer itemId returns nothing
1660 native RemoveUnitFromAllStock takes integer unitId returns nothing
1661 native RemoveUnitFromStock takes unit whichUnit, integer unitId returns nothing
1662
1663 native SetAllItemTypeSlots takes integer slots returns nothing
1664 native SetAllUnitTypeSlots takes integer slots returns nothing
1665 native SetItemTypeSlots takes unit whichUnit, integer slots returns nothing
1666 native SetUnitTypeSlots takes unit whichUnit, integer slots returns nothing
1667
1668 native GetUnitUserData takes unit whichUnit returns integer
1669 native SetUnitUserData takes unit whichUnit, integer data returns nothing
1670
1671 //============================================================================
1672 // Player API
1673 constant native Player takes integer number returns player
1674 constant native GetLocalPlayer takes nothing returns player
1675 constant native IsPlayerAlly takes player whichPlayer, player otherPlayer returns boolean
1676 constant native IsPlayerEnemy takes player whichPlayer, player otherPlayer returns boolean
1677 constant native IsPlayerInForce takes player whichPlayer, force whichForce returns boolean
1678 constant native IsPlayerObserver takes player whichPlayer returns boolean
1679 constant native IsVisibleToPlayer takes real x, real y, player whichPlayer returns boolean
1680 constant native IsLocationVisibleToPlayer takes location whichLocation, player whichPlayer returns boolean
1681 constant native IsFoggedToPlayer takes real x, real y, player whichPlayer returns boolean
1682 constant native IsLocationFoggedToPlayer takes location whichLocation, player whichPlayer returns boolean
1683 constant native IsMaskedToPlayer takes real x, real y, player whichPlayer returns boolean
1684 constant native IsLocationMaskedToPlayer takes location whichLocation, player whichPlayer returns boolean
1685
1686 constant native GetPlayerRace takes player whichPlayer returns race
1687 constant native GetPlayerId takes player whichPlayer returns integer
1688 constant native GetPlayerUnitCount takes player whichPlayer, boolean includeIncomplete returns integer
1689 constant native GetPlayerTypedUnitCount takes player whichPlayer, string unitName, boolean includeIncomplete, boolean includeUpgrades returns integer
1690 constant native GetPlayerStructureCount takes player whichPlayer, boolean includeIncomplete returns integer
1691 constant native GetPlayerState takes player whichPlayer, playerstate whichPlayerState returns integer
1692 constant native GetPlayerScore takes player whichPlayer, playerscore whichPlayerScore returns integer
1693 constant native GetPlayerAlliance takes player sourcePlayer, player otherPlayer, alliancetype whichAllianceSetting returns boolean
1694
1695 constant native GetPlayerHandicap takes player whichPlayer returns real
1696 constant native GetPlayerHandicapXP takes player whichPlayer returns real
1697 constant native SetPlayerHandicap takes player whichPlayer, real handicap returns nothing
1698 constant native SetPlayerHandicapXP takes player whichPlayer, real handicap returns nothing
1699
1700 constant native SetPlayerTechMaxAllowed takes player whichPlayer, integer techid, integer maximum returns nothing
1701 constant native GetPlayerTechMaxAllowed takes player whichPlayer, integer techid returns integer
1702 constant native AddPlayerTechResearched takes player whichPlayer, integer techid, integer levels returns nothing
1703 constant native SetPlayerTechResearched takes player whichPlayer, integer techid, integer setToLevel returns nothing
1704 constant native GetPlayerTechResearched takes player whichPlayer, integer techid, boolean specificonly returns boolean
1705 constant native GetPlayerTechCount takes player whichPlayer, integer techid, boolean specificonly returns integer
1706
1707 native SetPlayerUnitsOwner takes player whichPlayer, integer newOwner returns nothing
1708 native CripplePlayer takes player whichPlayer, force toWhichPlayers, boolean flag returns nothing
1709
1710 native SetPlayerAbilityAvailable takes player whichPlayer, integer abilid, boolean avail returns nothing
1711
1712 native SetPlayerState takes player whichPlayer, playerstate whichPlayerState, integer value returns nothing
1713 native RemovePlayer takes player whichPlayer, playergameresult gameResult returns nothing
1714
1715 // Used to store hero level data for the scorescreen
1716 // before units are moved to neutral passive in melee games
1717 //
1718 native CachePlayerHeroData takes player whichPlayer returns nothing
1719
1720 //============================================================================
1721 // Fog of War API
1722 native SetFogStateRect takes player forWhichPlayer, fogstate whichState, rect where, boolean useSharedVision returns nothing
1723 native SetFogStateRadius takes player forWhichPlayer, fogstate whichState, real centerx, real centerY, real radius, boolean useSharedVision returns nothing
1724 native SetFogStateRadiusLoc takes player forWhichPlayer, fogstate whichState, location center, real radius, boolean useSharedVision returns nothing
1725 native FogMaskEnable takes boolean enable returns nothing
1726 native IsFogMaskEnabled takes nothing returns boolean
1727 native FogEnable takes boolean enable returns nothing
1728 native IsFogEnabled takes nothing returns boolean
1729
1730 native CreateFogModifierRect takes player forWhichPlayer, fogstate whichState, rect where, boolean useSharedVision, boolean afterUnits returns fogmodifier
1731 native CreateFogModifierRadius takes player forWhichPlayer, fogstate whichState, real centerx, real centerY, real radius, boolean useSharedVision, boolean afterUnits returns fogmodifier
1732 native CreateFogModifierRadiusLoc takes player forWhichPlayer, fogstate whichState, location center, real radius, boolean useSharedVision, boolean afterUnits returns fogmodifier
1733 native DestroyFogModifier takes fogmodifier whichFogModifier returns nothing
1734 native FogModifierStart takes fogmodifier whichFogModifier returns nothing
1735 native FogModifierStop takes fogmodifier whichFogModifier returns nothing
1736
1737 //============================================================================
1738 // Game API
1739 native VersionGet takes nothing returns version
1740 native VersionCompatible takes version whichVersion returns boolean
1741 native VersionSupported takes version whichVersion returns boolean
1742
1743 native EndGame takes boolean doScoreScreen returns nothing
1744
1745 // Async only!
1746 native ChangeLevel takes string newLevel, boolean doScoreScreen returns nothing
1747 native RestartGame takes boolean doScoreScreen returns nothing
1748 native ReloadGame takes nothing returns nothing
1749 // %%% SetCampaignMenuRace is deprecated. It must remain to support
1750 // old maps which use it, but all new maps should use SetCampaignMenuRaceEx
1751 native SetCampaignMenuRace takes race r returns nothing
1752 native SetCampaignMenuRaceEx takes integer campaignIndex returns nothing
1753 native ForceCampaignSelectScreen takes nothing returns nothing
1754
1755 native LoadGame takes string saveFileName, boolean doScoreScreen returns nothing
1756 native SaveGame takes string saveFileName returns nothing
1757 native RenameSaveDirectory takes string sourceDirName, string destDirName returns boolean
1758 native RemoveSaveDirectory takes string sourceDirName returns boolean
1759 native CopySaveGame takes string sourceSaveName, string destSaveName returns boolean
1760 native SaveGameExists takes string saveName returns boolean
1761 native SyncSelections takes nothing returns nothing
1762 native SetFloatGameState takes fgamestate whichFloatGameState, real value returns nothing
1763 constant native GetFloatGameState takes fgamestate whichFloatGameState returns real
1764 native SetIntegerGameState takes igamestate whichIntegerGameState, integer value returns nothing
1765 constant native GetIntegerGameState takes igamestate whichIntegerGameState returns integer
1766
1767
1768 //============================================================================
1769 // Campaign API
1770 native SetTutorialCleared takes boolean cleared returns nothing
1771 native SetMissionAvailable takes integer campaignNumber, integer missionNumber, boolean available returns nothing
1772 native SetCampaignAvailable takes integer campaignNumber, boolean available returns nothing
1773 native SetOpCinematicAvailable takes integer campaignNumber, boolean available returns nothing
1774 native SetEdCinematicAvailable takes integer campaignNumber, boolean available returns nothing
1775 native GetDefaultDifficulty takes nothing returns gamedifficulty
1776 native SetDefaultDifficulty takes gamedifficulty g returns nothing
1777 native SetCustomCampaignButtonVisible takes integer whichButton, boolean visible returns nothing
1778 native GetCustomCampaignButtonVisible takes integer whichButton returns boolean
1779 native DoNotSaveReplay takes nothing returns nothing
1780
1781 //============================================================================
1782 // Dialog API
1783 native DialogCreate takes nothing returns dialog
1784 native DialogDestroy takes dialog whichDialog returns nothing
1785 native DialogClear takes dialog whichDialog returns nothing
1786 native DialogSetMessage takes dialog whichDialog, string messageText returns nothing
1787 native DialogAddButton takes dialog whichDialog, string buttonText, integer hotkey returns button
1788 native DialogAddQuitButton takes dialog whichDialog, boolean doScoreScreen, string buttonText, integer hotkey returns button
1789 native DialogDisplay takes player whichPlayer, dialog whichDialog, boolean flag returns nothing
1790
1791 // Creates a new or reads in an existing game cache file stored
1792 // in the current campaign profile dir
1793 //
1794 native ReloadGameCachesFromDisk takes nothing returns boolean
1795
1796 native InitGameCache takes string campaignFile returns gamecache
1797 native SaveGameCache takes gamecache whichCache returns boolean
1798
1799 native StoreInteger takes gamecache cache, string missionKey, string key, integer value returns nothing
1800 native StoreReal takes gamecache cache, string missionKey, string key, real value returns nothing
1801 native StoreBoolean takes gamecache cache, string missionKey, string key, boolean value returns nothing
1802 native StoreUnit takes gamecache cache, string missionKey, string key, unit whichUnit returns boolean
1803 native StoreString takes gamecache cache, string missionKey, string key, string value returns boolean
1804
1805 native SyncStoredInteger takes gamecache cache, string missionKey, string key returns nothing
1806 native SyncStoredReal takes gamecache cache, string missionKey, string key returns nothing
1807 native SyncStoredBoolean takes gamecache cache, string missionKey, string key returns nothing
1808 native SyncStoredUnit takes gamecache cache, string missionKey, string key returns nothing
1809 native SyncStoredString takes gamecache cache, string missionKey, string key returns nothing
1810
1811 // Will return 0 if the specified value's data is not found in the cache
1812 native GetStoredInteger takes gamecache cache, string missionKey, string key returns integer
1813 native GetStoredReal takes gamecache cache, string missionKey, string key returns real
1814 native GetStoredBoolean takes gamecache cache, string missionKey, string key returns boolean
1815 native GetStoredString takes gamecache cache, string missionKey, string key returns string
1816 native RestoreUnit takes gamecache cache, string missionKey, string key, player forWhichPlayer, real x, real y, real facing returns unit
1817
1818 native HaveStoredInteger takes gamecache cache, string missionKey, string key returns boolean
1819 native HaveStoredReal takes gamecache cache, string missionKey, string key returns boolean
1820 native HaveStoredBoolean takes gamecache cache, string missionKey, string key returns boolean
1821 native HaveStoredUnit takes gamecache cache, string missionKey, string key returns boolean
1822 native HaveStoredString takes gamecache cache, string missionKey, string key returns boolean
1823
1824 native FlushGameCache takes gamecache cache returns nothing
1825 native FlushStoredMission takes gamecache cache, string missionKey returns nothing
1826 native FlushStoredInteger takes gamecache cache, string missionKey, string key returns nothing
1827 native FlushStoredReal takes gamecache cache, string missionKey, string key returns nothing
1828 native FlushStoredBoolean takes gamecache cache, string missionKey, string key returns nothing
1829 native FlushStoredUnit takes gamecache cache, string missionKey, string key returns nothing
1830 native FlushStoredString takes gamecache cache, string missionKey, string key returns nothing
1831
1832 native InitHashtable takes nothing returns hashtable
1833
1834 native SaveInteger takes hashtable table, integer parentKey, integer childKey, integer value returns nothing
1835 native SaveReal takes hashtable table, integer parentKey, integer childKey, real value returns nothing
1836 native SaveBoolean takes hashtable table, integer parentKey, integer childKey, boolean value returns nothing
1837 native SaveStr takes hashtable table, integer parentKey, integer childKey, string value returns boolean
1838 native SavePlayerHandle takes hashtable table, integer parentKey, integer childKey, player whichPlayer returns boolean
1839 native SaveWidgetHandle takes hashtable table, integer parentKey, integer childKey, widget whichWidget returns boolean
1840 native SaveDestructableHandle takes hashtable table, integer parentKey, integer childKey, destructable whichDestructable returns boolean
1841 native SaveItemHandle takes hashtable table, integer parentKey, integer childKey, item whichItem returns boolean
1842 native SaveUnitHandle takes hashtable table, integer parentKey, integer childKey, unit whichUnit returns boolean
1843 native SaveAbilityHandle takes hashtable table, integer parentKey, integer childKey, ability whichAbility returns boolean
1844 native SaveTimerHandle takes hashtable table, integer parentKey, integer childKey, timer whichTimer returns boolean
1845 native SaveTriggerHandle takes hashtable table, integer parentKey, integer childKey, trigger whichTrigger returns boolean
1846 native SaveTriggerConditionHandle takes hashtable table, integer parentKey, integer childKey, triggercondition whichTriggercondition returns boolean
1847 native SaveTriggerActionHandle takes hashtable table, integer parentKey, integer childKey, triggeraction whichTriggeraction returns boolean
1848 native SaveTriggerEventHandle takes hashtable table, integer parentKey, integer childKey, event whichEvent returns boolean
1849 native SaveForceHandle takes hashtable table, integer parentKey, integer childKey, force whichForce returns boolean
1850 native SaveGroupHandle takes hashtable table, integer parentKey, integer childKey, group whichGroup returns boolean
1851 native SaveLocationHandle takes hashtable table, integer parentKey, integer childKey, location whichLocation returns boolean
1852 native SaveRectHandle takes hashtable table, integer parentKey, integer childKey, rect whichRect returns boolean
1853 native SaveBooleanExprHandle takes hashtable table, integer parentKey, integer childKey, boolexpr whichBoolexpr returns boolean
1854 native SaveSoundHandle takes hashtable table, integer parentKey, integer childKey, sound whichSound returns boolean
1855 native SaveEffectHandle takes hashtable table, integer parentKey, integer childKey, effect whichEffect returns boolean
1856 native SaveUnitPoolHandle takes hashtable table, integer parentKey, integer childKey, unitpool whichUnitpool returns boolean
1857 native SaveItemPoolHandle takes hashtable table, integer parentKey, integer childKey, itempool whichItempool returns boolean
1858 native SaveQuestHandle takes hashtable table, integer parentKey, integer childKey, quest whichQuest returns boolean
1859 native SaveQuestItemHandle takes hashtable table, integer parentKey, integer childKey, questitem whichQuestitem returns boolean
1860 native SaveDefeatConditionHandle takes hashtable table, integer parentKey, integer childKey, defeatcondition whichDefeatcondition returns boolean
1861 native SaveTimerDialogHandle takes hashtable table, integer parentKey, integer childKey, timerdialog whichTimerdialog returns boolean
1862 native SaveLeaderboardHandle takes hashtable table, integer parentKey, integer childKey, leaderboard whichLeaderboard returns boolean
1863 native SaveMultiboardHandle takes hashtable table, integer parentKey, integer childKey, multiboard whichMultiboard returns boolean
1864 native SaveMultiboardItemHandle takes hashtable table, integer parentKey, integer childKey, multiboarditem whichMultiboarditem returns boolean
1865 native SaveTrackableHandle takes hashtable table, integer parentKey, integer childKey, trackable whichTrackable returns boolean
1866 native SaveDialogHandle takes hashtable table, integer parentKey, integer childKey, dialog whichDialog returns boolean
1867 native SaveButtonHandle takes hashtable table, integer parentKey, integer childKey, button whichButton returns boolean
1868 native SaveTextTagHandle takes hashtable table, integer parentKey, integer childKey, texttag whichTexttag returns boolean
1869 native SaveLightningHandle takes hashtable table, integer parentKey, integer childKey, lightning whichLightning returns boolean
1870 native SaveImageHandle takes hashtable table, integer parentKey, integer childKey, image whichImage returns boolean
1871 native SaveUbersplatHandle takes hashtable table, integer parentKey, integer childKey, ubersplat whichUbersplat returns boolean
1872 native SaveRegionHandle takes hashtable table, integer parentKey, integer childKey, region whichRegion returns boolean
1873 native SaveFogStateHandle takes hashtable table, integer parentKey, integer childKey, fogstate whichFogState returns boolean
1874 native SaveFogModifierHandle takes hashtable table, integer parentKey, integer childKey, fogmodifier whichFogModifier returns boolean
1875 native SaveAgentHandle takes hashtable table, integer parentKey, integer childKey, agent whichAgent returns boolean
1876 native SaveHashtableHandle takes hashtable table, integer parentKey, integer childKey, hashtable whichHashtable returns boolean
1877
1878
1879 native LoadInteger takes hashtable table, integer parentKey, integer childKey returns integer
1880 native LoadReal takes hashtable table, integer parentKey, integer childKey returns real
1881 native LoadBoolean takes hashtable table, integer parentKey, integer childKey returns boolean
1882 native LoadStr takes hashtable table, integer parentKey, integer childKey returns string
1883 native LoadPlayerHandle takes hashtable table, integer parentKey, integer childKey returns player
1884 native LoadWidgetHandle takes hashtable table, integer parentKey, integer childKey returns widget
1885 native LoadDestructableHandle takes hashtable table, integer parentKey, integer childKey returns destructable
1886 native LoadItemHandle takes hashtable table, integer parentKey, integer childKey returns item
1887 native LoadUnitHandle takes hashtable table, integer parentKey, integer childKey returns unit
1888 native LoadAbilityHandle takes hashtable table, integer parentKey, integer childKey returns ability
1889 native LoadTimerHandle takes hashtable table, integer parentKey, integer childKey returns timer
1890 native LoadTriggerHandle takes hashtable table, integer parentKey, integer childKey returns trigger
1891 native LoadTriggerConditionHandle takes hashtable table, integer parentKey, integer childKey returns triggercondition
1892 native LoadTriggerActionHandle takes hashtable table, integer parentKey, integer childKey returns triggeraction
1893 native LoadTriggerEventHandle takes hashtable table, integer parentKey, integer childKey returns event
1894 native LoadForceHandle takes hashtable table, integer parentKey, integer childKey returns force
1895 native LoadGroupHandle takes hashtable table, integer parentKey, integer childKey returns group
1896 native LoadLocationHandle takes hashtable table, integer parentKey, integer childKey returns location
1897 native LoadRectHandle takes hashtable table, integer parentKey, integer childKey returns rect
1898 native LoadBooleanExprHandle takes hashtable table, integer parentKey, integer childKey returns boolexpr
1899 native LoadSoundHandle takes hashtable table, integer parentKey, integer childKey returns sound
1900 native LoadEffectHandle takes hashtable table, integer parentKey, integer childKey returns effect
1901 native LoadUnitPoolHandle takes hashtable table, integer parentKey, integer childKey returns unitpool
1902 native LoadItemPoolHandle takes hashtable table, integer parentKey, integer childKey returns itempool
1903 native LoadQuestHandle takes hashtable table, integer parentKey, integer childKey returns quest
1904 native LoadQuestItemHandle takes hashtable table, integer parentKey, integer childKey returns questitem
1905 native LoadDefeatConditionHandle takes hashtable table, integer parentKey, integer childKey returns defeatcondition
1906 native LoadTimerDialogHandle takes hashtable table, integer parentKey, integer childKey returns timerdialog
1907 native LoadLeaderboardHandle takes hashtable table, integer parentKey, integer childKey returns leaderboard
1908 native LoadMultiboardHandle takes hashtable table, integer parentKey, integer childKey returns multiboard
1909 native LoadMultiboardItemHandle takes hashtable table, integer parentKey, integer childKey returns multiboarditem
1910 native LoadTrackableHandle takes hashtable table, integer parentKey, integer childKey returns trackable
1911 native LoadDialogHandle takes hashtable table, integer parentKey, integer childKey returns dialog
1912 native LoadButtonHandle takes hashtable table, integer parentKey, integer childKey returns button
1913 native LoadTextTagHandle takes hashtable table, integer parentKey, integer childKey returns texttag
1914 native LoadLightningHandle takes hashtable table, integer parentKey, integer childKey returns lightning
1915 native LoadImageHandle takes hashtable table, integer parentKey, integer childKey returns image
1916 native LoadUbersplatHandle takes hashtable table, integer parentKey, integer childKey returns ubersplat
1917 native LoadRegionHandle takes hashtable table, integer parentKey, integer childKey returns region
1918 native LoadFogStateHandle takes hashtable table, integer parentKey, integer childKey returns fogstate
1919 native LoadFogModifierHandle takes hashtable table, integer parentKey, integer childKey returns fogmodifier
1920 native LoadHashtableHandle takes hashtable table, integer parentKey, integer childKey returns hashtable
1921
1922 native HaveSavedInteger takes hashtable table, integer parentKey, integer childKey returns boolean
1923 native HaveSavedReal takes hashtable table, integer parentKey, integer childKey returns boolean
1924 native HaveSavedBoolean takes hashtable table, integer parentKey, integer childKey returns boolean
1925 native HaveSavedString takes hashtable table, integer parentKey, integer childKey returns boolean
1926 native HaveSavedHandle takes hashtable table, integer parentKey, integer childKey returns boolean
1927
1928 native RemoveSavedInteger takes hashtable table, integer parentKey, integer childKey returns nothing
1929 native RemoveSavedReal takes hashtable table, integer parentKey, integer childKey returns nothing
1930 native RemoveSavedBoolean takes hashtable table, integer parentKey, integer childKey returns nothing
1931 native RemoveSavedString takes hashtable table, integer parentKey, integer childKey returns nothing
1932 native RemoveSavedHandle takes hashtable table, integer parentKey, integer childKey returns nothing
1933
1934 native FlushParentHashtable takes hashtable table returns nothing
1935 native FlushChildHashtable takes hashtable table, integer parentKey returns nothing
1936
1937 //============================================================================
1938 // Randomization API
1939 native GetRandomInt takes integer lowBound, integer highBound returns integer
1940 native GetRandomReal takes real lowBound, real highBound returns real
1941
1942 native CreateUnitPool takes nothing returns unitpool
1943 native DestroyUnitPool takes unitpool whichPool returns nothing
1944 native UnitPoolAddUnitType takes unitpool whichPool, integer unitId, real weight returns nothing
1945 native UnitPoolRemoveUnitType takes unitpool whichPool, integer unitId returns nothing
1946 native PlaceRandomUnit takes unitpool whichPool, player forWhichPlayer, real x, real y, real facing returns unit
1947
1948 native CreateItemPool takes nothing returns itempool
1949 native DestroyItemPool takes itempool whichItemPool returns nothing
1950 native ItemPoolAddItemType takes itempool whichItemPool, integer itemId, real weight returns nothing
1951 native ItemPoolRemoveItemType takes itempool whichItemPool, integer itemId returns nothing
1952 native PlaceRandomItem takes itempool whichItemPool, real x, real y returns item
1953
1954 // Choose any random unit/item. (NP means Neutral Passive)
1955 native ChooseRandomCreep takes integer level returns integer
1956 native ChooseRandomNPBuilding takes nothing returns integer
1957 native ChooseRandomItem takes integer level returns integer
1958 native ChooseRandomItemEx takes itemtype whichType, integer level returns integer
1959 native SetRandomSeed takes integer seed returns nothing
1960
1961 //============================================================================
1962 // Visual API
1963 native SetTerrainFog takes real a, real b, real c, real d, real e returns nothing
1964 native ResetTerrainFog takes nothing returns nothing
1965
1966 native SetUnitFog takes real a, real b, real c, real d, real e returns nothing
1967 native SetTerrainFogEx takes integer style, real zstart, real zend, real density, real red, real green, real blue returns nothing
1968 native DisplayTextToPlayer takes player toPlayer, real x, real y, string message returns nothing
1969 native DisplayTimedTextToPlayer takes player toPlayer, real x, real y, real duration, string message returns nothing
1970 native DisplayTimedTextFromPlayer takes player toPlayer, real x, real y, real duration, string message returns nothing
1971 native ClearTextMessages takes nothing returns nothing
1972 native SetDayNightModels takes string terrainDNCFile, string unitDNCFile returns nothing
1973 native SetSkyModel takes string skyModelFile returns nothing
1974 native EnableUserControl takes boolean b returns nothing
1975 native EnableUserUI takes boolean b returns nothing
1976 native SuspendTimeOfDay takes boolean b returns nothing
1977 native SetTimeOfDayScale takes real r returns nothing
1978 native GetTimeOfDayScale takes nothing returns real
1979 native ShowInterface takes boolean flag, real fadeDuration returns nothing
1980 native PauseGame takes boolean flag returns nothing
1981 native UnitAddIndicator takes unit whichUnit, integer red, integer green, integer blue, integer alpha returns nothing
1982 native AddIndicator takes widget whichWidget, integer red, integer green, integer blue, integer alpha returns nothing
1983 native PingMinimap takes real x, real y, real duration returns nothing
1984 native PingMinimapEx takes real x, real y, real duration, integer red, integer green, integer blue, boolean extraEffects returns nothing
1985 native EnableOcclusion takes boolean flag returns nothing
1986 native SetIntroShotText takes string introText returns nothing
1987 native SetIntroShotModel takes string introModelPath returns nothing
1988 native EnableWorldFogBoundary takes boolean b returns nothing
1989 native PlayModelCinematic takes string modelName returns nothing
1990 native PlayCinematic takes string movieName returns nothing
1991 native ForceUIKey takes string key returns nothing
1992 native ForceUICancel takes nothing returns nothing
1993 native DisplayLoadDialog takes nothing returns nothing
1994 native SetAltMinimapIcon takes string iconPath returns nothing
1995 native DisableRestartMission takes boolean flag returns nothing
1996
1997 native CreateTextTag takes nothing returns texttag
1998 native DestroyTextTag takes texttag t returns nothing
1999 native SetTextTagText takes texttag t, string s, real height returns nothing
2000 native SetTextTagPos takes texttag t, real x, real y, real heightOffset returns nothing
2001 native SetTextTagPosUnit takes texttag t, unit whichUnit, real heightOffset returns nothing
2002 native SetTextTagColor takes texttag t, integer red, integer green, integer blue, integer alpha returns nothing
2003 native SetTextTagVelocity takes texttag t, real xvel, real yvel returns nothing
2004 native SetTextTagVisibility takes texttag t, boolean flag returns nothing
2005 native SetTextTagSuspended takes texttag t, boolean flag returns nothing
2006 native SetTextTagPermanent takes texttag t, boolean flag returns nothing
2007 native SetTextTagAge takes texttag t, real age returns nothing
2008 native SetTextTagLifespan takes texttag t, real lifespan returns nothing
2009 native SetTextTagFadepoint takes texttag t, real fadepoint returns nothing
2010
2011 native SetReservedLocalHeroButtons takes integer reserved returns nothing
2012 native GetAllyColorFilterState takes nothing returns integer
2013 native SetAllyColorFilterState takes integer state returns nothing
2014 native GetCreepCampFilterState takes nothing returns boolean
2015 native SetCreepCampFilterState takes boolean state returns nothing
2016 native EnableMinimapFilterButtons takes boolean enableAlly, boolean enableCreep returns nothing
2017 native EnableDragSelect takes boolean state, boolean ui returns nothing
2018 native EnablePreSelect takes boolean state, boolean ui returns nothing
2019 native EnableSelect takes boolean state, boolean ui returns nothing
2020
2021 //============================================================================
2022 // Trackable API
2023 native CreateTrackable takes string trackableModelPath, real x, real y, real facing returns trackable
2024
2025 //============================================================================
2026 // Quest API
2027 native CreateQuest takes nothing returns quest
2028 native DestroyQuest takes quest whichQuest returns nothing
2029 native QuestSetTitle takes quest whichQuest, string title returns nothing
2030 native QuestSetDescription takes quest whichQuest, string description returns nothing
2031 native QuestSetIconPath takes quest whichQuest, string iconPath returns nothing
2032
2033 native QuestSetRequired takes quest whichQuest, boolean required returns nothing
2034 native QuestSetCompleted takes quest whichQuest, boolean completed returns nothing
2035 native QuestSetDiscovered takes quest whichQuest, boolean discovered returns nothing
2036 native QuestSetFailed takes quest whichQuest, boolean failed returns nothing
2037 native QuestSetEnabled takes quest whichQuest, boolean enabled returns nothing
2038
2039 native IsQuestRequired takes quest whichQuest returns boolean
2040 native IsQuestCompleted takes quest whichQuest returns boolean
2041 native IsQuestDiscovered takes quest whichQuest returns boolean
2042 native IsQuestFailed takes quest whichQuest returns boolean
2043 native IsQuestEnabled takes quest whichQuest returns boolean
2044
2045 native QuestCreateItem takes quest whichQuest returns questitem
2046 native QuestItemSetDescription takes questitem whichQuestItem, string description returns nothing
2047 native QuestItemSetCompleted takes questitem whichQuestItem, boolean completed returns nothing
2048
2049 native IsQuestItemCompleted takes questitem whichQuestItem returns boolean
2050
2051 native CreateDefeatCondition takes nothing returns defeatcondition
2052 native DestroyDefeatCondition takes defeatcondition whichCondition returns nothing
2053 native DefeatConditionSetDescription takes defeatcondition whichCondition, string description returns nothing
2054
2055 native FlashQuestDialogButton takes nothing returns nothing
2056 native ForceQuestDialogUpdate takes nothing returns nothing
2057
2058 //============================================================================
2059 // Timer Dialog API
2060 native CreateTimerDialog takes timer t returns timerdialog
2061 native DestroyTimerDialog takes timerdialog whichDialog returns nothing
2062 native TimerDialogSetTitle takes timerdialog whichDialog, string title returns nothing
2063 native TimerDialogSetTitleColor takes timerdialog whichDialog, integer red, integer green, integer blue, integer alpha returns nothing
2064 native TimerDialogSetTimeColor takes timerdialog whichDialog, integer red, integer green, integer blue, integer alpha returns nothing
2065 native TimerDialogSetSpeed takes timerdialog whichDialog, real speedMultFactor returns nothing
2066 native TimerDialogDisplay takes timerdialog whichDialog, boolean display returns nothing
2067 native IsTimerDialogDisplayed takes timerdialog whichDialog returns boolean
2068 native TimerDialogSetRealTimeRemaining takes timerdialog whichDialog, real timeRemaining returns nothing
2069
2070 //============================================================================
2071 // Leaderboard API
2072
2073 // Create a leaderboard object
2074 native CreateLeaderboard takes nothing returns leaderboard
2075 native DestroyLeaderboard takes leaderboard lb returns nothing
2076
2077 native LeaderboardDisplay takes leaderboard lb, boolean show returns nothing
2078 native IsLeaderboardDisplayed takes leaderboard lb returns boolean
2079
2080 native LeaderboardGetItemCount takes leaderboard lb returns integer
2081
2082 native LeaderboardSetSizeByItemCount takes leaderboard lb, integer count returns nothing
2083 native LeaderboardAddItem takes leaderboard lb, string label, integer value, player p returns nothing
2084 native LeaderboardRemoveItem takes leaderboard lb, integer index returns nothing
2085 native LeaderboardRemovePlayerItem takes leaderboard lb, player p returns nothing
2086 native LeaderboardClear takes leaderboard lb returns nothing
2087
2088 native LeaderboardSortItemsByValue takes leaderboard lb, boolean ascending returns nothing
2089 native LeaderboardSortItemsByPlayer takes leaderboard lb, boolean ascending returns nothing
2090 native LeaderboardSortItemsByLabel takes leaderboard lb, boolean ascending returns nothing
2091
2092 native LeaderboardHasPlayerItem takes leaderboard lb, player p returns boolean
2093 native LeaderboardGetPlayerIndex takes leaderboard lb, player p returns integer
2094 native LeaderboardSetLabel takes leaderboard lb, string label returns nothing
2095 native LeaderboardGetLabelText takes leaderboard lb returns string
2096
2097 native PlayerSetLeaderboard takes player toPlayer, leaderboard lb returns nothing
2098 native PlayerGetLeaderboard takes player toPlayer returns leaderboard
2099
2100 native LeaderboardSetLabelColor takes leaderboard lb, integer red, integer green, integer blue, integer alpha returns nothing
2101 native LeaderboardSetValueColor takes leaderboard lb, integer red, integer green, integer blue, integer alpha returns nothing
2102 native LeaderboardSetStyle takes leaderboard lb, boolean showLabel, boolean showNames, boolean showValues, boolean showIcons returns nothing
2103
2104 native LeaderboardSetItemValue takes leaderboard lb, integer whichItem, integer val returns nothing
2105 native LeaderboardSetItemLabel takes leaderboard lb, integer whichItem, string val returns nothing
2106 native LeaderboardSetItemStyle takes leaderboard lb, integer whichItem, boolean showLabel, boolean showValue, boolean showIcon returns nothing
2107 native LeaderboardSetItemLabelColor takes leaderboard lb, integer whichItem, integer red, integer green, integer blue, integer alpha returns nothing
2108 native LeaderboardSetItemValueColor takes leaderboard lb, integer whichItem, integer red, integer green, integer blue, integer alpha returns nothing
2109
2110 //============================================================================
2111 // Multiboard API
2112 //============================================================================
2113
2114 // Create a multiboard object
2115 native CreateMultiboard takes nothing returns multiboard
2116 native DestroyMultiboard takes multiboard lb returns nothing
2117
2118 native MultiboardDisplay takes multiboard lb, boolean show returns nothing
2119 native IsMultiboardDisplayed takes multiboard lb returns boolean
2120
2121 native MultiboardMinimize takes multiboard lb, boolean minimize returns nothing
2122 native IsMultiboardMinimized takes multiboard lb returns boolean
2123 native MultiboardClear takes multiboard lb returns nothing
2124
2125 native MultiboardSetTitleText takes multiboard lb, string label returns nothing
2126 native MultiboardGetTitleText takes multiboard lb returns string
2127 native MultiboardSetTitleTextColor takes multiboard lb, integer red, integer green, integer blue, integer alpha returns nothing
2128
2129 native MultiboardGetRowCount takes multiboard lb returns integer
2130 native MultiboardGetColumnCount takes multiboard lb returns integer
2131
2132 native MultiboardSetColumnCount takes multiboard lb, integer count returns nothing
2133 native MultiboardSetRowCount takes multiboard lb, integer count returns nothing
2134
2135 // broadcast settings to all items
2136 native MultiboardSetItemsStyle takes multiboard lb, boolean showValues, boolean showIcons returns nothing
2137 native MultiboardSetItemsValue takes multiboard lb, string value returns nothing
2138 native MultiboardSetItemsValueColor takes multiboard lb, integer red, integer green, integer blue, integer alpha returns nothing
2139 native MultiboardSetItemsWidth takes multiboard lb, real width returns nothing
2140 native MultiboardSetItemsIcon takes multiboard lb, string iconPath returns nothing
2141
2142
2143 // funcs for modifying individual items
2144 native MultiboardGetItem takes multiboard lb, integer row, integer column returns multiboarditem
2145 native MultiboardReleaseItem takes multiboarditem mbi returns nothing
2146
2147 native MultiboardSetItemStyle takes multiboarditem mbi, boolean showValue, boolean showIcon returns nothing
2148 native MultiboardSetItemValue takes multiboarditem mbi, string val returns nothing
2149 native MultiboardSetItemValueColor takes multiboarditem mbi, integer red, integer green, integer blue, integer alpha returns nothing
2150 native MultiboardSetItemWidth takes multiboarditem mbi, real width returns nothing
2151 native MultiboardSetItemIcon takes multiboarditem mbi, string iconFileName returns nothing
2152
2153 // meant to unequivocally suspend display of existing and
2154 // subsequently displayed multiboards
2155 //
2156 native MultiboardSuppressDisplay takes boolean flag returns nothing
2157
2158 //============================================================================
2159 // Camera API
2160 native SetCameraPosition takes real x, real y returns nothing
2161 native SetCameraQuickPosition takes real x, real y returns nothing
2162 native SetCameraBounds takes real x1, real y1, real x2, real y2, real x3, real y3, real x4, real y4 returns nothing
2163 native StopCamera takes nothing returns nothing
2164 native ResetToGameCamera takes real duration returns nothing
2165 native PanCameraTo takes real x, real y returns nothing
2166 native PanCameraToTimed takes real x, real y, real duration returns nothing
2167 native PanCameraToWithZ takes real x, real y, real zOffsetDest returns nothing
2168 native PanCameraToTimedWithZ takes real x, real y, real zOffsetDest, real duration returns nothing
2169 native SetCinematicCamera takes string cameraModelFile returns nothing
2170 native SetCameraRotateMode takes real x, real y, real radiansToSweep, real duration returns nothing
2171 native SetCameraField takes camerafield whichField, real value, real duration returns nothing
2172 native AdjustCameraField takes camerafield whichField, real offset, real duration returns nothing
2173 native SetCameraTargetController takes unit whichUnit, real xoffset, real yoffset, boolean inheritOrientation returns nothing
2174 native SetCameraOrientController takes unit whichUnit, real xoffset, real yoffset returns nothing
2175
2176 native CreateCameraSetup takes nothing returns camerasetup
2177 native CameraSetupSetField takes camerasetup whichSetup, camerafield whichField, real value, real duration returns nothing
2178 native CameraSetupGetField takes camerasetup whichSetup, camerafield whichField returns real
2179 native CameraSetupSetDestPosition takes camerasetup whichSetup, real x, real y, real duration returns nothing
2180 native CameraSetupGetDestPositionLoc takes camerasetup whichSetup returns location
2181 native CameraSetupGetDestPositionX takes camerasetup whichSetup returns real
2182 native CameraSetupGetDestPositionY takes camerasetup whichSetup returns real
2183 native CameraSetupApply takes camerasetup whichSetup, boolean doPan, boolean panTimed returns nothing
2184 native CameraSetupApplyWithZ takes camerasetup whichSetup, real zDestOffset returns nothing
2185 native CameraSetupApplyForceDuration takes camerasetup whichSetup, boolean doPan, real forceDuration returns nothing
2186 native CameraSetupApplyForceDurationWithZ takes camerasetup whichSetup, real zDestOffset, real forceDuration returns nothing
2187
2188 native CameraSetTargetNoise takes real mag, real velocity returns nothing
2189 native CameraSetSourceNoise takes real mag, real velocity returns nothing
2190
2191 native CameraSetTargetNoiseEx takes real mag, real velocity, boolean vertOnly returns nothing
2192 native CameraSetSourceNoiseEx takes real mag, real velocity, boolean vertOnly returns nothing
2193
2194 native CameraSetSmoothingFactor takes real factor returns nothing
2195
2196 native SetCineFilterTexture takes string filename returns nothing
2197 native SetCineFilterBlendMode takes blendmode whichMode returns nothing
2198 native SetCineFilterTexMapFlags takes texmapflags whichFlags returns nothing
2199 native SetCineFilterStartUV takes real minu, real minv, real maxu, real maxv returns nothing
2200 native SetCineFilterEndUV takes real minu, real minv, real maxu, real maxv returns nothing
2201 native SetCineFilterStartColor takes integer red, integer green, integer blue, integer alpha returns nothing
2202 native SetCineFilterEndColor takes integer red, integer green, integer blue, integer alpha returns nothing
2203 native SetCineFilterDuration takes real duration returns nothing
2204 native DisplayCineFilter takes boolean flag returns nothing
2205 native IsCineFilterDisplayed takes nothing returns boolean
2206
2207 native SetCinematicScene takes integer portraitUnitId, playercolor color, string speakerTitle, string text, real sceneDuration, real voiceoverDuration returns nothing
2208 native EndCinematicScene takes nothing returns nothing
2209 native ForceCinematicSubtitles takes boolean flag returns nothing
2210
2211 native GetCameraMargin takes integer whichMargin returns real
2212
2213 // These return values for the local players camera only...
2214 constant native GetCameraBoundMinX takes nothing returns real
2215 constant native GetCameraBoundMinY takes nothing returns real
2216 constant native GetCameraBoundMaxX takes nothing returns real
2217 constant native GetCameraBoundMaxY takes nothing returns real
2218 constant native GetCameraField takes camerafield whichField returns real
2219 constant native GetCameraTargetPositionX takes nothing returns real
2220 constant native GetCameraTargetPositionY takes nothing returns real
2221 constant native GetCameraTargetPositionZ takes nothing returns real
2222 constant native GetCameraTargetPositionLoc takes nothing returns location
2223 constant native GetCameraEyePositionX takes nothing returns real
2224 constant native GetCameraEyePositionY takes nothing returns real
2225 constant native GetCameraEyePositionZ takes nothing returns real
2226 constant native GetCameraEyePositionLoc takes nothing returns location
2227
2228 //============================================================================
2229 // Sound API
2230 //
2231 native NewSoundEnvironment takes string environmentName returns nothing
2232
2233 native CreateSound takes string fileName, boolean looping, boolean is3D, boolean stopwhenoutofrange, integer fadeInRate, integer fadeOutRate, string eaxSetting returns sound
2234 native CreateSoundFilenameWithLabel takes string fileName, boolean looping, boolean is3D, boolean stopwhenoutofrange, integer fadeInRate, integer fadeOutRate, string SLKEntryName returns sound
2235 native CreateSoundFromLabel takes string soundLabel, boolean looping, boolean is3D, boolean stopwhenoutofrange, integer fadeInRate, integer fadeOutRate returns sound
2236 native CreateMIDISound takes string soundLabel, integer fadeInRate, integer fadeOutRate returns sound
2237
2238 native SetSoundParamsFromLabel takes sound soundHandle, string soundLabel returns nothing
2239 native SetSoundDistanceCutoff takes sound soundHandle, real cutoff returns nothing
2240 native SetSoundChannel takes sound soundHandle, integer channel returns nothing
2241 native SetSoundVolume takes sound soundHandle, integer volume returns nothing
2242 native SetSoundPitch takes sound soundHandle, real pitch returns nothing
2243
2244 // the following method must be called immediately after calling "StartSound"
2245 native SetSoundPlayPosition takes sound soundHandle, integer millisecs returns nothing
2246
2247 // these calls are only valid if the sound was created with 3d enabled
2248 native SetSoundDistances takes sound soundHandle, real minDist, real maxDist returns nothing
2249 native SetSoundConeAngles takes sound soundHandle, real inside, real outside, integer outsideVolume returns nothing
2250 native SetSoundConeOrientation takes sound soundHandle, real x, real y, real z returns nothing
2251 native SetSoundPosition takes sound soundHandle, real x, real y, real z returns nothing
2252 native SetSoundVelocity takes sound soundHandle, real x, real y, real z returns nothing
2253 native AttachSoundToUnit takes sound soundHandle, unit whichUnit returns nothing
2254
2255 native StartSound takes sound soundHandle returns nothing
2256 native StopSound takes sound soundHandle, boolean killWhenDone, boolean fadeOut returns nothing
2257 native KillSoundWhenDone takes sound soundHandle returns nothing
2258
2259 // Music Interface. Note that if music is disabled, these calls do nothing
2260 native SetMapMusic takes string musicName, boolean random, integer index returns nothing
2261 native ClearMapMusic takes nothing returns nothing
2262
2263 native PlayMusic takes string musicName returns nothing
2264 native PlayMusicEx takes string musicName, integer frommsecs, integer fadeinmsecs returns nothing
2265 native StopMusic takes boolean fadeOut returns nothing
2266 native ResumeMusic takes nothing returns nothing
2267
2268 native PlayThematicMusic takes string musicFileName returns nothing
2269 native PlayThematicMusicEx takes string musicFileName, integer frommsecs returns nothing
2270 native EndThematicMusic takes nothing returns nothing
2271
2272 native SetMusicVolume takes integer volume returns nothing
2273 native SetMusicPlayPosition takes integer millisecs returns nothing
2274 native SetThematicMusicPlayPosition takes integer millisecs returns nothing
2275
2276 // other music and sound calls
2277 native SetSoundDuration takes sound soundHandle, integer duration returns nothing
2278 native GetSoundDuration takes sound soundHandle returns integer
2279 native GetSoundFileDuration takes string musicFileName returns integer
2280
2281 native VolumeGroupSetVolume takes volumegroup vgroup, real scale returns nothing
2282 native VolumeGroupReset takes nothing returns nothing
2283
2284 native GetSoundIsPlaying takes sound soundHandle returns boolean
2285 native GetSoundIsLoading takes sound soundHandle returns boolean
2286
2287 native RegisterStackedSound takes sound soundHandle, boolean byPosition, real rectwidth, real rectheight returns nothing
2288 native UnregisterStackedSound takes sound soundHandle, boolean byPosition, real rectwidth, real rectheight returns nothing
2289
2290 //============================================================================
2291 // Effects API
2292 //
2293 native AddWeatherEffect takes rect where, integer effectID returns weathereffect
2294 native RemoveWeatherEffect takes weathereffect whichEffect returns nothing
2295 native EnableWeatherEffect takes weathereffect whichEffect, boolean enable returns nothing
2296
2297 native TerrainDeformCrater takes real x, real y, real radius, real depth, integer duration, boolean permanent returns terraindeformation
2298 native TerrainDeformRipple takes real x, real y, real radius, real depth, integer duration, integer count, real spaceWaves, real timeWaves, real radiusStartPct, boolean limitNeg returns terraindeformation
2299 native TerrainDeformWave takes real x, real y, real dirX, real dirY, real distance, real speed, real radius, real depth, integer trailTime, integer count returns terraindeformation
2300 native TerrainDeformRandom takes real x, real y, real radius, real minDelta, real maxDelta, integer duration, integer updateInterval returns terraindeformation
2301 native TerrainDeformStop takes terraindeformation deformation, integer duration returns nothing
2302 native TerrainDeformStopAll takes nothing returns nothing
2303
2304 native AddSpecialEffect takes string modelName, real x, real y returns effect
2305 native AddSpecialEffectLoc takes string modelName, location where returns effect
2306 native AddSpecialEffectTarget takes string modelName, widget targetWidget, string attachPointName returns effect
2307 native DestroyEffect takes effect whichEffect returns nothing
2308
2309 native AddSpellEffect takes string abilityString, effecttype t, real x, real y returns effect
2310 native AddSpellEffectLoc takes string abilityString, effecttype t,location where returns effect
2311 native AddSpellEffectById takes integer abilityId, effecttype t,real x, real y returns effect
2312 native AddSpellEffectByIdLoc takes integer abilityId, effecttype t,location where returns effect
2313 native AddSpellEffectTarget takes string modelName, effecttype t, widget targetWidget, string attachPoint returns effect
2314 native AddSpellEffectTargetById takes integer abilityId, effecttype t, widget targetWidget, string attachPoint returns effect
2315
2316 native AddLightning takes string codeName, boolean checkVisibility, real x1, real y1, real x2, real y2 returns lightning
2317 native AddLightningEx takes string codeName, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns lightning
2318 native DestroyLightning takes lightning whichBolt returns boolean
2319 native MoveLightning takes lightning whichBolt, boolean checkVisibility, real x1, real y1, real x2, real y2 returns boolean
2320 native MoveLightningEx takes lightning whichBolt, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns boolean
2321 native GetLightningColorA takes lightning whichBolt returns real
2322 native GetLightningColorR takes lightning whichBolt returns real
2323 native GetLightningColorG takes lightning whichBolt returns real
2324 native GetLightningColorB takes lightning whichBolt returns real
2325 native SetLightningColor takes lightning whichBolt, real r, real g, real b, real a returns boolean
2326
2327 native GetAbilityEffect takes string abilityString, effecttype t, integer index returns string
2328 native GetAbilityEffectById takes integer abilityId, effecttype t, integer index returns string
2329 native GetAbilitySound takes string abilityString, soundtype t returns string
2330 native GetAbilitySoundById takes integer abilityId, soundtype t returns string
2331
2332 //============================================================================
2333 // Terrain API
2334 //
2335 native GetTerrainCliffLevel takes real x, real y returns integer
2336 native SetWaterBaseColor takes integer red, integer green, integer blue, integer alpha returns nothing
2337 native SetWaterDeforms takes boolean val returns nothing
2338 native GetTerrainType takes real x, real y returns integer
2339 native GetTerrainVariance takes real x, real y returns integer
2340 native SetTerrainType takes real x, real y, integer terrainType, integer variation, integer area, integer shape returns nothing
2341 native IsTerrainPathable takes real x, real y, pathingtype t returns boolean
2342 native SetTerrainPathable takes real x, real y, pathingtype t, boolean flag returns nothing
2343
2344 //============================================================================
2345 // Image API
2346 //
2347 native CreateImage takes string file, real sizeX, real sizeY, real sizeZ, real posX, real posY, real posZ, real originX, real originY, real originZ, integer imageType returns image
2348 native DestroyImage takes image whichImage returns nothing
2349 native ShowImage takes image whichImage, boolean flag returns nothing
2350 native SetImageConstantHeight takes image whichImage, boolean flag, real height returns nothing
2351 native SetImagePosition takes image whichImage, real x, real y, real z returns nothing
2352 native SetImageColor takes image whichImage, integer red, integer green, integer blue, integer alpha returns nothing
2353 native SetImageRender takes image whichImage, boolean flag returns nothing
2354 native SetImageRenderAlways takes image whichImage, boolean flag returns nothing
2355 native SetImageAboveWater takes image whichImage, boolean flag, boolean useWaterAlpha returns nothing
2356 native SetImageType takes image whichImage, integer imageType returns nothing
2357
2358 //============================================================================
2359 // Ubersplat API
2360 //
2361 native CreateUbersplat takes real x, real y, string name, integer red, integer green, integer blue, integer alpha, boolean forcePaused, boolean noBirthTime returns ubersplat
2362 native DestroyUbersplat takes ubersplat whichSplat returns nothing
2363 native ResetUbersplat takes ubersplat whichSplat returns nothing
2364 native FinishUbersplat takes ubersplat whichSplat returns nothing
2365 native ShowUbersplat takes ubersplat whichSplat, boolean flag returns nothing
2366 native SetUbersplatRender takes ubersplat whichSplat, boolean flag returns nothing
2367 native SetUbersplatRenderAlways takes ubersplat whichSplat, boolean flag returns nothing
2368
2369 //============================================================================
2370 // Blight API
2371 //
2372 native SetBlight takes player whichPlayer, real x, real y, real radius, boolean addBlight returns nothing
2373 native SetBlightRect takes player whichPlayer, rect r, boolean addBlight returns nothing
2374 native SetBlightPoint takes player whichPlayer, real x, real y, boolean addBlight returns nothing
2375 native SetBlightLoc takes player whichPlayer, location whichLocation, real radius, boolean addBlight returns nothing
2376 native CreateBlightedGoldmine takes player id, real x, real y, real face returns unit
2377 native IsPointBlighted takes real x, real y returns boolean
2378
2379 //============================================================================
2380 // Doodad API
2381 //
2382 native SetDoodadAnimation takes real x, real y, real radius, integer doodadID, boolean nearestOnly, string animName, boolean animRandom returns nothing
2383 native SetDoodadAnimationRect takes rect r, integer doodadID, string animName, boolean animRandom returns nothing
2384
2385 //============================================================================
2386 // Computer AI interface
2387 //
2388 native StartMeleeAI takes player num, string script returns nothing
2389 native StartCampaignAI takes player num, string script returns nothing
2390 native CommandAI takes player num, integer command, integer data returns nothing
2391 native PauseCompAI takes player p, boolean pause returns nothing
2392 native GetAIDifficulty takes player num returns aidifficulty
2393
2394 native RemoveGuardPosition takes unit hUnit returns nothing
2395 native RecycleGuardPosition takes unit hUnit returns nothing
2396 native RemoveAllGuardPositions takes player num returns nothing
2397
2398 //============================================================================
2399 native Cheat takes string cheatStr returns nothing
2400 native IsNoVictoryCheat takes nothing returns boolean
2401 native IsNoDefeatCheat takes nothing returns boolean
2402
2403 native Preload takes string filename returns nothing
2404 native PreloadEnd takes real timeout returns nothing
2405
2406 native PreloadStart takes nothing returns nothing
2407 native PreloadRefresh takes nothing returns nothing
2408 native PreloadEndEx takes nothing returns nothing
2409
2410 native PreloadGenClear takes nothing returns nothing
2411 native PreloadGenStart takes nothing returns nothing
2412 native PreloadGenEnd takes string filename returns nothing
2413 native Preloader takes string filename returns nothing